Thread: Resource files and GIF files

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    610

    Resource files and GIF files

    Noticed when creating a resource file, only a bmp option is available... Problem with BMP is they always have a background (or enclosing rectangle)... With gifs you can have them with transparent Background.. Thing is i would like to animate an image with a specific shape (ball/aircraft, etc) on a client window... But now the BMP has this white block around it! How do i create a transparent background resource file?

  2. #2
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    Last edited by BobS0327; 06-20-2008 at 06:12 AM.

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    610
    Quote Originally Posted by BobS0327 View Post
    Can't see how this helps.... Or is my question not clear

  4. #4
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    But now the BMP has this white block around it! How do i create a transparent background resource file?
    The animated example demonstrates how to eliminate the above problem.

  5. #5
    Registered User
    Join Date
    Apr 2008
    Posts
    610
    Quote Originally Posted by BobS0327 View Post
    The animated example demonstrates how to eliminate the above problem.
    Maybe am dumb, can't read anywhere the author talks about making the ball background transparent... Perhaps all he did was to have the background white, which wont show on a white window anyway.... Please indicate if i skipped some statements there... sometimes i read too fast missing important fine lines

  6. #6
    Registered User
    Join Date
    Apr 2007
    Posts
    137
    You can add, of course, GIF or any format in resource
    (read MSDN...)

  7. #7
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    Please indicate if i skipped some statements there... sometimes i read too fast missing important fine lines
    Unfortunately, the author discusses this subject in generalities and really doesn't get into the details. Download the complete anim_one package and review the CreateBitmapMask function.

  8. #8
    Registered User
    Join Date
    Mar 2007
    Posts
    142
    CreateBitmapMask is discussed elsewhere: Graphics Device Interface - Transparent Bitmaps.

    But, when it comes to GIFs, just include it into your resorce script.

    128 GIF DISCARDABLE MyPicture.gif

    and use it like this:

    hRsrc = FindResource (hInstance, MAKEINTRESOURCE(128), TEXT("GIF"));

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GIF patent
    By dwks in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 05-15-2006, 05:41 PM
  2. using jpg and gif files
    By Unregistered in forum Windows Programming
    Replies: 2
    Last Post: 08-28-2001, 07:57 PM