Thread: Displaying a transparent gif

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    28

    Displaying a transparent gif

    Hello,

    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?

    Thanks,

    Just

  2. #2
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    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 cplusplus.com of some interest:

    http://www.cplusplus.com/src/wingif.zip

    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:

    http://www.libpng.org/pub/png/

    edit: This looks like a more in depth discussion and includes use of gdiplus:

    http://dogma.net/markn/articles/IPicture/
    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
    Posts
    28
    Thanks for the reply Ken. But I'd already given up on displaying transparent gifs. I'd already seen the article at dogma.net, 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.

    Just
    "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 Cprogramming.com
    Replies: 4
    Last Post: 11-24-2002, 11:33 AM