Thread: Loading image from Resource

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    58

    Loading image from Resource

    In my .rc file I have such:
    Code:
    icon ICON "wxVertigo.ico"
    
    splashImage BMP "Splash.bmp"
    and the Splash.bmp file IS included within the binary, when I check the size to tell, but I have no idea how to access this image as a resource!

    How do I access this image for use in my program? E.G. using it in image handling functions?

    -Thank You!

  2. #2
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    LoadImage() might be what you're looking for, since you're including it in a windows resource file.

    If you're looking to use it with wx functions, however, you might poke around and see if wx has a method of pulling from resources (I think they provide a few examples?). If they don't, you can use the more generic call LoadResource() to load it into memory, and then use the appropriate wx functions to transform it into something the wx API can use.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading tiff image files?
    By compz in forum C++ Programming
    Replies: 9
    Last Post: 10-30-2009, 04:17 AM
  2. Loading an image in from a resource file
    By starcatcher in forum C++ Programming
    Replies: 4
    Last Post: 04-15-2008, 06:44 AM
  3. Loading a bitmap (Without using glaux)
    By Shamino in forum Game Programming
    Replies: 7
    Last Post: 03-16-2006, 09:43 AM
  4. Image class - loading image file
    By GaPe in forum Windows Programming
    Replies: 2
    Last Post: 07-11-2004, 01:35 PM
  5. How to change a mouse cursor in console mode
    By GaPe in forum Windows Programming
    Replies: 10
    Last Post: 07-03-2002, 07:42 AM