Hi!
I recently got WpTools 6. I am developing an RTF text editor and use the method SaveToStream to save the text into a blob in the database. But when I try to save an image, this is not saved correctly, data is lost, resulting not I then open that text in another part of the program to display the formatted text.
The text is saved as:
Zitat\rtf1\ansi\deff0\uc1\ansicpg1252\deftab720{\fonttbl{\f0\fnil\fcharset1 Times New Roman;}{\f1\fnil\fcharset1 Arial;}{\f2\fnil\fcharset2 Wingdings;}{\f3\fnil\fcharset2 Symbol;}}{\colortbl\red0\green0\blue0;\red255\green0\blue0;\red0\green128\blue0;\red0\green0\blue255;\red255\green255\blue0;\red255\green0\blue255;\red128\green0\blue128;
\red128\green0\blue0;\red0\green255\blue0;\red0\green255\blue255;\red0\green128\blue128;\red0\green0\blue128;\red255\green255\blue255;\red192\green192\blue192;
\red128\green128\blue128;\red0\green0\blue0;}
\wpprheadfoot1\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\headery720\footery720\endnhere\sectdefaultcl{\*\generator WPTools_6.060;}{\qj\plain\f1\fs22{\pict\dibitmap0\wbmbitspixel32\wbmplanes1\wbmwidthbytes936\picw234\pich69\picwgoal3510\pichgoal1035
\bin64624 (
I searched for answers in the forum but could not find them. Please excuse me if this has been posted. What should I do? Am I doing something wrong when saving? My routine insertion of the image and saving the text are as follows:
ZitatAlles anzeigenprocedure TRichEditMaskForm.EditImageExecute(Sender: TObject);
var
Pict: TPicture;
begin
with TOpenPictureDialog.Create(nil) do
try
InitialDir := GetCurrentDir;
Filter := GraphicFilter(TBitmap) + '|' +
GraphicFilter(TJPegImage) + '|' +
GraphicFilter(TMetafile);
Options := Options + [ofPathMustExist, ofFileMustExist];
if Execute then
begin
Pict := TPicture.Create;
try
Pict.LoadFromFile(FileName);
Clipboard.Assign(Pict);
Editor.PasteFromClipboard;
finally
Pict.Free;
end;
end;
finally
Free;
end;
end;
ZitatAlles anzeigenprocedure FileSaveExecute(Sender: TObject);
var
bs: TStream;
begin
bs := nil;if Assigned(Field) then
try
Field.DataSet.Edit;
bs := Field.DataSet.CreateBlobStream(Field, bmWrite);
Editor.SaveToStream(bs);
Editor.Modified := False;
SetModified(False);
with tbFormatacao do
if (State in dsEditModes) then
Post;
Modified := False;
finally
bs.Free;
end;
end;
Please, help me!
Thanks.
Karen