Display jpg, PNG, GIF, and GIF animations-Reply to "Grant" Questions

Source: Internet
Author: User
Problem Source: http://www.cnblogs.com/del/archive/2009/03/15/1412384.html#1477470
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls, extctrls; Type tform1 = Class (tform) button1: tbutton; button2: tbutton; button3: tbutton; button4: tbutton; Procedure button1click (Sender: tobject); Procedure submit (Sender: tobject); Procedure alert: tobject); end; var form1: tform1; implementation {$ R *. DFM} uses JPEG, gifimg, pngimage; {display jpg image} procedure tform1.button1click (Sender: tobject); var JPG: Tsung image; begin JPG: = Tsung image. create; JPG. loadfromfile ('C: \ temp \ test.jpg '); canvas. draw (0, 0, JPG); JPG. free; end; {display PNG Image} procedure tform1.button2click (Sender: tobject); var PNG: tpngimage; begin PNG: = tpngimage. create; PNG. loadfromfile ('C: \ temp \ test.png '); canvas. draw (0, 0, PNG); PNG. free; end; {display GIF image} procedure tform1.button3click (Sender: tobject); var GIF: tgifimage; begin GIF: = tgifimage. create; GIF. loadfromfile ('C: \ temp \ test.gif '); canvas. draw (0, 0, GIF); GIF. free; end; {display GIF animation} procedure tform1.button4click (Sender: tobject); var GIF: tgifimage; begin GIF: = tgifimage. create; GIF. loadfromfile ('C: \ temp \ test.gif '); GIF. animate: = true; with timage. create (Self) Do begin parent: = self; left: = 0; top: = 0; picture. assign (GIF); end; GIF. free; end.
 
  
 

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.