DelphiFAQ Home Search:

GIF / PNG / JPEG lightweight Image Control

 

comments2 comments. Current rating: 3 stars (1 votes). Leave comments and/ or rate it.

Question:

Does Windows have a lightweight image control to display GIF, PNG or JPEG images?

Answer:

Windows only seems not to have such a standard control for displaying JPEG, PNG and GIF images. You can (ab)use the ListView control for this purpose - ListView controls have the capability to display JPEG, PNG, GIF, BMP, WMF and EMF images.

To use a TListView control as a simple image control, you need to send a message. See the other tip about this topic: Problem putting a background image on a TListView.

Notes:


  • This requires comctl32.dll 4.71 and above.
  • animated GIF are displayed as normal GIF, and only the first frame is displayed.
  • Images cannot be stretched and must be loaded from external files.
  • (It appears that) the path to the image file has to be an absolute path

(where hCtlListView1 is the handle of the ListView control and where szFileName is the FULL path of the image file to be displayed).



Comments:

2005-12-08, 00:42:36
anonymous from Russian Federation  
it's poor info.
I don't undrstand. Whre put images in ListView.
2006-03-29, 18:35:20
anonymous from Netherlands  
rating
timagelist, dynamic loading of images, there is also a patch for the 32bit image glitch

 

 

Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option.
 
It seems that you are
from Los Angeles, US .

Info/ Feedback on this

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:
photo Add a picture:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity. The owner of this web site reserves the right to delete such material.