Results 1 to 3 of 3

Thread: Loading JPG from resource file

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    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.

  2. #2
    Lively Member
    Join Date
    Mar 2000
    Posts
    115
    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.
    Vuen

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    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)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width