Hi! I have a text saved by wptools. In that text, there is a special tag, wich must be replaced by an image (User signagture).
The code I'm using:
Code
procedure GeraAssinatura(var wpEditor: TWPRichText; CodigoUsuario, TagImagem: String);
var Image1: TImage;
BlobStream: TStream;
JPEGImage: TJPEGImage;
TextObject: TWPOImage;
begin
Image1 := TImage.Create(Image1);
with dmana do
begin
q_assinatura.Close;
q_assinatura.DataSet.Params[0].Value := w_empresa;
q_assinatura.DataSet.Params[1].Value := w_estab;
q_assinatura.DataSet.Params[2].Value := CodigoUsuario;
q_assinatura.Open;
if q_assinaturaASSINATURA_USUARIO.BlobSize <> 0 then
begin
BlobStream := q_assinatura.CreateBlobStream(q_assinaturaASSINATURA_USUARIO, bmRead);
JPEGImage := TJPEGImage.Create;
try
JPEGImage.LoadFromStream(BlobStream);
Image1.Picture.Assign(JPEGImage);
finally
BlobStream.Free;
JPEGImage.Free;
end;
end
else Image1.Picture := nil;
end;
wpEditor.Finder.ToStart;
while wpEditor.Finder.Next(TagImagem) do
begin
wpEditor.CPPosition := wpEditor.Finder.FoundPosition;
wpEditor.Finder.FoundText := '';
wpEditor.TextObjects.InsertCopy(Image1.Picture.Graphic);
end;
wpEditor.DelayedReformat;
end;
Alles anzeigen
When I run the program, it works great! The wprich passed to that procedure shows the image perfectlly. But, when I use FastAppendText, or CopyToClipboard and PasteFromClipboard, to copy that text to the end of another wprich object, the image is not copied!
I'm doing something wrong?? Help me!!
Thanks