PDA

Click to See Complete Forum and Search --> : LoadResPicture()


Mad Compie
Nov 27th, 2001, 02:32 PM
Hi kids.

I wonder if I could also use the VB LoadResPicture() function to load JPG, GIF files from a .RES file???

The manual says that a .RES files can only support .BMP and .ICO

jim mcnamara
Nov 29th, 2001, 04:21 PM
That's correct - no jpg.

There are other controls that you use to handle multiple images - the Kodak ImgEdit &ImgAdmin controls that come with VB 6.0

Go here for sample code from the guys who wrote the controls:

http://www.eistream.com/support_pro/Link_Pages/sample_code.htm

Mad Compie
Nov 30th, 2001, 12:48 AM
I know, but I want to embed certain graphics in my app.
Using the classical methods (images, pictureboxes, ...) it takes a long time before the whole thing is loaded.
When using a resource file, the load time would reduce!
Now I found out that I also can use LoadResData(), then assigning it to a Byte array, saving it to a file and then restoring the image by reading the file with LoadPicture().

Any other (faster) methods available?

Arbiter
Nov 30th, 2001, 01:39 AM
I try to shy away from storing images in RES files and store them with the program (in a directory called graphics for example).

You can load them at the beginning of the program (using a splash screen to keep the user amused). It makes updating the program easier and makes the .exe much smaller.

Mad Compie
Nov 30th, 2001, 01:35 PM
I don't want the user to be able to see my graphics !!!!

Arbiter
Nov 30th, 2001, 08:17 PM
You could always save them as data001.dat, data002.dat and then they've no idea they only have to rename the file to .jpg to view them.

Why don't you want people to see the graphics anyway, they're going to see them in the program - if they want them, they need only do a screen capture....

Mad Compie
Dec 1st, 2001, 06:45 AM
It's a GUI to manipulate our domotics system.
http://www.domotech.com/images/Remote.gif
I don't want the user to be able to change all the graphics which I have spent many hours to create them (like: icons, backgrounds, ...)

I experimented with LoadResData in combination with file I/O and measured the time to load & save graphics files (about 15Kb each) with GetTickCount(). This API reported most of the time 0ms. So, I presume that not many CPU time has been lost...not?

Result: I will use LoadResData to import BMP, GIF, JPG, ... with a maximum size of 64Kb (otherwise it will be slower).

Advantage: My app won't take a long time to start up.