Resource Files...adding and using images..................... 
Author Message
 Resource Files...adding and using images.....................
I have 5 images that I want to package with my program, 4 of them are very
small, and one is a large background.   I want to load them all at the
beginning, so I put this in the form load event:

LoadResPicture(103, vbResBitmap) As IPictureDisp
LoadResPicture(105, vbResBitmap) As IPictureDisp
LoadResPicture(104, vbResBitmap) As IPictureDisp
LoadResPicture(102, vbResBitmap) As IPictureDisp
LoadResPicture(101, vbResBitmap) As IPictureDisp

The respective file names are Game.bmp, rmirror.bmp, lmirror.bmp, brmirror.bmp,
blmirror.bmp.  Unfortunately, from all of the documentation, out of 6 VB books
and
my MSDN library have nothing more than the above syntax........and only
instructions on how to put the files in the .RES file.   They do not tell me
how to
assign the pictures to each picture box, and also, the code above does not seem
to work, so I must be missing quite a bit of what I really need to do.   What
am I missing?

There is more faith in honest doubt than in all creeds combined.

http://www.*-*-*.com/
Free - A VB strings function tutor! - Now Updated with VB6 Functions!
Latin, History, Great Pyramid, Spanish Castle.



Wed, 19 Dec 2001 03:00:00 GMT  
 Resource Files...adding and using images.....................
You use LoadResPicture just like you use LoadPicture with files:

        Picture1.Picture = LoadResPicture(103, vbResBitmap)
        Picture2.Picture = LoadResPicture(105, vbResBitmap)
        Picture3.Picture = LoadResPicture(104, vbResBitmap)
        Picture4.Picture = LoadResPicture(102, vbResBitmap)

Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner


Quote:

>I have 5 images that I want to package with my program, 4 of them are very
>small, and one is a large background.   I want to load them all at the
>beginning, so I put this in the form load event:

>LoadResPicture(103, vbResBitmap) As IPictureDisp
>LoadResPicture(105, vbResBitmap) As IPictureDisp
>LoadResPicture(104, vbResBitmap) As IPictureDisp
>LoadResPicture(102, vbResBitmap) As IPictureDisp
>LoadResPicture(101, vbResBitmap) As IPictureDisp

>The respective file names are Game.bmp, rmirror.bmp, lmirror.bmp, brmirror.bmp,
>blmirror.bmp.  Unfortunately, from all of the documentation, out of 6 VB books
>and
>my MSDN library have nothing more than the above syntax........and only
>instructions on how to put the files in the .RES file.   They do not tell me
>how to
>assign the pictures to each picture box, and also, the code above does not seem
>to work, so I must be missing quite a bit of what I really need to do.   What
>am I missing?

>There is more faith in honest doubt than in all creeds combined.

>http://www.angelfire.com/az/desertavatar
>Free - A VB strings function tutor! - Now Updated with VB6 Functions!
>Latin, History, Great Pyramid, Spanish Castle.



Wed, 19 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. adding resources to the resource sheet in ms project using vba

2. Using resource file to load Tab strip images

3. Using resource file to load Tab strip images

4. DAO Blob Adding/Extracting (audio files, text files, image files, program files)

5. image Resources, how to add?

6. adding new image to RESOURCE at runtime?

7. Adding an avi file to a resource file

8. Adding BMP file to Resource file with bad results

9. Loss of system-resources using Pisture / Image-Object

10. minimize resources with image or pictureBox or resource???

11. Using gif files in a resource file

12. Adding resources to Global Resource Pool

 

 
Powered by phpBB® Forum Software