Results 1 to 7 of 7

Thread: LoadResPicture()

  1. #1

    Thread Starter
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553

    Exclamation LoadResPicture()

    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

  2. #2
    jim mcnamara
    Guest
    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/...ample_code.htm

  3. #3

    Thread Starter
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    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?

  4. #4
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    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.
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  5. #5

    Thread Starter
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553
    I don't want the user to be able to see my graphics !!!!

  6. #6
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    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....
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  7. #7

    Thread Starter
    Fanatic Member Mad Compie's Avatar
    Join Date
    Aug 2000
    Location
    Kuurne (Belgium)
    Posts
    553

    Thumbs up

    It's a GUI to manipulate our domotics system.

    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.

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