• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

Sample code for APNG Support

Started by Alp, 10 March 2010, 19:00:17

Previous topic - Next topic

Alp

Hi all, is there any sample code for using apng image? I mean i want to show an apng (transparent) image on my form but i couldn't find any sample code for it.
Thanks right now...

Galfar

Check out VCL Image Browser and LCL Imager demos - they both can load and display APNG images.
Basically you need to load the image into TMultiImage and then convert each frame to VCL TBitmap descendant which you can easily display on form.
 

Alp

Thank you for your reply, but i mean i want to show the animation.
With another word, i want to assign an animated png file to any control then let it animates the file.. Is it possible? or should i assign all frames one by one?
Thanks right now..

Galfar

There's no self animated TGraphic class in Imaging currently.
You could manually switch frames one by one (you'll need to know frame delays for proper animation read from the file - this will be in SVN repository during today). Another option is to modify ExtraGIF mod found in Imaging\Extras\Contrib\ExtraGIF (self animating class for GIF images) to support APNG images as well.

Isaev

Quote from: Galfar on 12 March 2010, 18:16:31
Basically you need to load the image into TMultiImage and then convert each frame to VCL TBitmap descendant which you can easily display on form.

Var
  FImage: ImagingClasses.TMultiImage;
begin
  FImage := TMultiImage.Create;
  FImage.LoadMultiFromFile('post_63_33.png');
  //img1.Picture.Bitmap.Assign(FImage); ???
  FImage.Free;
end;

How to display animation in TImage? Whether it is possible or I need ExtraGIF?
write an example of use if it isn't difficult, for apng file

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name:
Email:

Shortcuts: ALT+S save/post or ALT+P preview

SMF spam blocked by CleanTalk