Thread: Displaying a transparent gif

  1. #1
    Registered User
    Join Date
    Mar 2003

    Displaying a transparent gif


    Can anyone tell me how to display a transparent gif on a dialog, in MS Visual C++ 6? The standard picture control only likes bitmaps, and the Microsoft Forms 2.0 Image control won't display the gif transparently. What's strange is that when using the Forms 2.0 Image control, the gif looks perfect in the resource editor (complete with transparency) but is not transparent when the program is actually run. Any ideas?



  2. #2
    Join Date
    Jan 2002
    You might try OleLoadPicture or OleLoadPictureFile - search this board for examples/discussions but I doubt it will do what you require but it's relatively quick and easy to use.

    Other than that you might find this example from of some interest:

    A search on google may turn up some useful image processing libs for you to use. You could always abandon the use of gifs and use pngs instead, then use the free zlib/libpng:

    edit: This looks like a more in depth discussion and includes use of gdiplus:
    Last edited by Ken Fitlike; 05-09-2003 at 09:43 PM.
    CProgramming FAQ
    Caution: this person may be a carrier of the misinformation virus.

  3. #3
    Registered User
    Join Date
    Mar 2003
    Thanks for the reply Ken. But I'd already given up on displaying transparent gifs. I'd already seen the article at, and couldn't get their code working properly. And using an external lib or pngs unfortunately wasn't an option for me.

    Oh well, thanks anyway.

    "C++ is like jamming a helicopter inside a Miata and expecting some sort of improvement."
    - Drew Olbrich

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Transparent, Editbox, HOLLOW_BRUSH, Marking text?
    By Dampy in forum Windows Programming
    Replies: 6
    Last Post: 09-22-2008, 07:17 PM
  2. Transparent bmp on top of webcam feed?
    By h3ro in forum Windows Programming
    Replies: 4
    Last Post: 08-06-2008, 09:45 AM
  3. Transparent panels overlapped
    By AtomRiot in forum C# Programming
    Replies: 3
    Last Post: 04-21-2007, 09:16 PM
  4. OSD or transparent window
    By Mox in forum Windows Programming
    Replies: 5
    Last Post: 01-28-2003, 06:31 PM
  5. Displaying a GIF in Java.
    By sean in forum A Brief History of
    Replies: 4
    Last Post: 11-24-2002, 11:33 AM