ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 PasteFromClipboard crashes with GIF Image format
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

933 Posts

Posted - Mar 28 2014 :  10:27:18  Show Profile  Reply
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?

w2m

USA
1990 Posts

Posted - Mar 28 2014 :  11:06:09  Show Profile  Reply
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;

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: