Custom image resource file

Nafto
02-06-2005, 09:34 PM
Hey everyone,
so i have this program that i have about 3 images for. So i was learning about custom resource files, and I decided to make these 3 images into one. I followed the tutorial on gpwiki.org (good site), but the one thing i don't get is how to convert back from the file into the pictures. I have the info for all the pictures in 3 seperate variables, which i know how to put into an empty file to create the .jpg or whatever but this isn't what i want. I was to use these images as a picture of an image control. So basically to load them into a ipicturedisplay somehow, without creating the file for each picture. So basically when the program loads it decompresses this small resource file and loads the pictures. So how do I do this? the loadpicture only works with an existing file as far as i know, and useing set variable = variable2 doesn't work, where variable is the ipicturedisp and var2 is the var holding the image data. Please tell me what to do it'd be a big help.

OnErr0r
02-06-2005, 10:21 PM
First off, do NOT create more than one thread with the same subject on different boards (the other two were deleted).

If your image is a JPG you'll need to load it with LoadResData and then convert it to IPictureDisp using API. Search the forum for PictureFromRes, I posted the function. Once the image is in an StdPicture you can draw it using the PaintPicture method of a picturebox or form. Since you have multiple images in one, I'll assume it's a vertical or horizontal image strip (or possibly both). Simply provide the target coords and source coords of the image strip and draw it.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum