PDA

Click to See Complete Forum and Search --> : Loading JPG from resource file


amitabh
Dec 28th, 2000, 09:45 AM
I have a resource file which has JPG's as custom resource. The problem is that i am not able to load the jpg into a variable of type "IPictureDisp" using either LoadResData or even LoadResBitmap. If I directly load the jpg using loadpicture function(using the jpg file name), it works smoothly.

Am I using the wrong datatype or is there some other way to load JPg's from a resource file.

Vuen
Jan 2nd, 2001, 11:13 PM
Umm... I think it's doable with the GetDIBits or something function... One of these people has a site on how to do it. Darn and I even have it bookmarked, except this isnt my computer im working at.

amitabh
Jan 4th, 2001, 03:02 AM
I have been successful in loading a JPG file from a resource by using LoadResData function. The concept is to read the data in bytes, and hten store it in a temp file. Load the temp file into the control as required. I don't have hte address right now but this solution is from Microsoft's website. They even have a demo project for loading JPG's and GIF's.(Search the KB)