Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading JPEGs from resources

Status
Not open for further replies.

makaveliuk

Programmer
Dec 1, 2003
46
GB
I am trying to display a high colour splash screen on my app, using the bitmap resource caused it to become 16 colour and look awful.

I have managed to display it using GDI+ and load the JPEG file, but I would ideally like it to be a built-in resource, so I have created a custom resource and imported the JPEG, but I cannot get it to load it from the resource.

Any ideas how to do it? Or maybe a way round the colour problem?
 
How are you attempting to load it from the resources? Custom resources need to be handled differently from "ordinary" ones...

[tt]________________________________________________________________
[pc2]Roger
Life is a game of cards in which the deck contains only jokers.[/tt]
 
I was loading the resource with FindResource() and LockResource() then using allocating and copying into memory to be used as an IStream, then I attempt to load it with Gdiplus::Bitmap::FromStream() but it does not display anything when I come to draw the image.
 
Have a look at faq116-1096, which gives lots of information on loadeing images.

[tt]________________________________________________________________
[pc2]Roger
Life is a game of cards in which the deck contains only jokers.[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top