Delphi Loading GIF images

Source: Internet
Author: User

First, download the Tgifimage.pas unit first. Step: [Project]-->[add to Project ...] Select the Tgifimage.pas unit and compile it.

When using Timage to load the display GIF is usually installed tgifimage to extend the implementation, there will be dynamic creation of controls in use, but if the GIF picture is loaded directly, GIF animation will not move, it is necessary to create a Tgifimage class to load the animation, Finally, give it to timage. The code is as follows:

  1. Procedure Tform1.button1click (Sender:tobject);
  2. Var
  3. Objimg:timage;
  4. Objgif:tgifimage;
  5. Begin
  6. If Opendialog1.execute Then
  7. Begin
  8. Objimg: = Timage.create (self);
  9. Objimg.parent: = self;
  10. Objimg.setbounds (10, 20, 140, 200);
  11. Objgif: = tgifimage.create;
  12. Objgif.loadfromfile (Opendialog1.filename);
  13. ObjImg.Picture.Assign (objgif);
  14. Tgifimage (objImg.Picture.Graphic). Animate: = True;
  15. End
  16. End

Delphi Loading GIF images

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.