There are many types of picture files, and some of them have multiple "sub types" too. Unfortunately several popular types have been created (or extended) since VB6 was released, so it does not support them.


Supported file types
This is the list of types shown in the help for VB6 (under LoadPicture - online version here):
Graphics formats recognized by Visual Basic include
  • bitmap (.bmp) files,
  • icon (.ico) files,
  • cursor (.cur) files,
  • run-length encoded (.rle) files,
  • metafile (.wmf) files,
  • enhanced metafiles (.emf),
  • GIF (.gif) files,
  • and JPEG (.jpg) files.
A note about icon (.ico) files
These have evolved over the years, and many of the icons you find on the web are not supported.

VB6 only supports icons that have a size of 32x32 or 16x16, and a color depth of "True Color" (24-bit) or "256 Colors" (8 bit) or less - so no alpha channel (32 bit).

If you find icons that are described as "XP icons" or "Vista icons", they are unlikely to load in VB - if they do, it is because suitable icons are also included in the file too (a .ico file can contain multiple pictures).

You can convert icons to a suitable format using an icon editing program (see the article How can I create/find icons to use in my program?), and there have been threads on the forums explaining how you can convert/use them at run time (but note that it is not an easy task) which you can find by searching the forums.


Other file types
If the file type you want to load is not listed above, you will need to do some extra work.

The easiest way (if you only have a few files) is to use a paint program to convert the picture file to one of the types listed above.

There are many situations where that is not valid (such as when you want the user to be able to load .png files), in which case you either need to find pre-written code (or a component) to load the file for you, or write the code yourself.

There are several pre-made solutions in our CodeBank - VB6 forum, to find them I would recommend starting with a search by thread title for the file type you are interested in (eg: for .png files, the keyword would be png )