Hi! I need to load several image files into a TJvRichEdit. TJvRichEdit allows to insert a TGraphic. So I tried the following:
procedure TForm1.btnTestClick(Sender: TObject);
var
P: TPicture;
begin
// imgDummy: TImageEn
imgDummy.IO.LoadFromFileAuto('D:\MyImage1.jpg');
P := TPicture.Create;
try
imgDummy.CopyToBitmapWithAlpha(P.Bitmap, 0, 0);
// RichEdit: TJvRichEdit
// RichEdit.InsertGraphic(AGraphic: Vcl.Graphics.TGraphic; Sizeable: Boolean)
RichEdit.InsertGraphic(P.Graphic, False);
finally
P.Free;
end;
end;
However, this does not work. So how can I copy the image from TImageEn to TGraphic?