Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
PeterPanino
Posted - Mar 28 2014 : 10:27:18 Hi! I have a TImageEnProc component on a form, where the AttachedTImage property is set to a TImage on the form.
I have a GIF Image format in the clipboard:
Now, when I use this code then the program crashes:
ImageEnProc1.PasteFromClipboard;
So how can I paste the GIF Image clipboard format with ImageEnProc1.PasteFromClipboard?
1 L A T E S T R E P L I E S (Newest First)
w2m
Posted - Mar 28 2014 : 11:06:09 Do you have gifimg in uses?
If not, then Image.Picture has not registered the TGifImage format with TPicture, which explains why you are getting an exception.
Unlike TImageEnView, TImage is a very old component and only recognizes the TBitmap and TIcon formats without the assistance of other libaries. If you add the other file formats like Jpeg or PngImage they will be recognized as well.
or you can just call hyieutils.IERegisterFormats which registers all the ImageEnIO supported file formats with TPicture and the other file types (gifimg, pngimage, jpg) do not have to be in uses. In this case, formats such as TIF, JP2, Jp2000 and all other ImageEnIO formats will be recognized by TImage.Picture.
procedure TForm1.FormCreate(Sender: TObject);
begin
IERegisterFormats;
OpenPictureDialog1.filter := GraphicFilter(TGraphic);
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
IEUnRegisterFormats;
end;