Evan
Nov 4th, 1999, 10:29 PM
Ok,
I have about 25 pictures on a Form.. But Not Visable ( For the use of the Form I need them) But It takes SOOOO long to start that Form.
So I need to Learn a Better Way to Store Pictures ( That doesnt open them strait from the Hard drive ).
How do I do this?
thankx
MartinLiss
Nov 4th, 1999, 10:35 PM
This is from Help:
Adding Pictures to Your Application
Pictures can be displayed in three places in Visual Basic applications:
On a form
In a picture box
In an image control
Pictures can come from paint programs, such as those that ship with the various versions of Microsoft Windows, other graphics applications, or clip-art libraries. Visual Basic provides a large collection of icons you can use as graphics in applications. Visual Basic allows you to add .jpg and .gif files, as well as .bmp, .dib, .ico, .cur, .wmf, and .emf files to your applications. For more information about the graphics formats supported by Visual Basic, see "Using the Image Control" and "Using the Picture Box Control" in "Using Visual Basic's Standard Controls."
You use different techniques to add a picture to a form, a picture box, or an image control depending on whether you add the picture at design time or run time.
Adding a Picture at Design Time
There are two ways to add a picture at design time:
Load a picture onto a form, or into a picture box or image control from a picture file:
In the Properties window, select Picture from the Properties list and click the Properties button. Visual Basic displays a dialog box, from which you select a picture file.
If you set the Picture property for a form, the picture you select is displayed on the form, behind any controls you’ve placed on it. Likewise, if you set the Picture property for a picture box, the picture is displayed in the box, behind any controls you’ve placed on it.
Paste a picture onto a form or into a picture box or image control:
Copy a picture from another application (such as Microsoft Paint) onto the Clipboard. Return to Visual Basic, select the form, picture box, or image control, and from the Edit menu, choose Paste.
Once you’ve set the Picture property for a form, picture box, or image control — either by loading or pasting a picture — the word displayed in the Settings box is " (Bitmap), " " (Icon), " or " (Metafile). " To change the setting, load or paste another picture. To set the Picture property to " (None) " again, double-click the word displayed in the Settings box and press the DEL key.
Adding a Picture at Run Time
There are four ways to add a picture at run time:
Use the LoadPicture function to specify a file name and assign the picture to the Picture property.
The following statement loads the file Cars.bmp into a picture box named picDisplay (you name a control by setting its Name property):
picDisplay.Picture = LoadPicture("C:\Picts\Cars.bmp")
You can load a new picture file onto a form or into a picture box or image control whenever you want. Loading a new picture completely replaces the existing picture, although the source files of the pictures are never affected.
Use the LoadResPicture function to assign a picture from the project’s .res file into the Picture property.
The following statement loads the bitmap resource ID, 10, from the resource file into a picture box named picResource:
Set picResource.Picture = LoadResPicture(10, _
vbResBitmap)
Copy a picture from one object to another.
Once a picture is loaded or pasted onto a form or into a picture box or image control, you can assign it to other forms, picture boxes, or image controls at run time. For example, this statement copies a picture from a picture box named picDisplay to an image control named imgDisplay:
Set imgDisplay.Picture = picDisplay.Picture
Copy a picture from the Clipboard object.
For More Information For more information about copying a picture from the Clipboard, see "Working with Multiple Formats on the Clipboard."
For information on resource files, see "Working with Resource Files" in "More About Programming."
Note If you load or paste pictures from files at design time, the pictures are saved and loaded with the form, and the application copies pictures from one object to another. Then, when you create an .exe file, you don’t need to give your users copies of the picture files; the .exe file itself contains the images. Also, consider supplying a .res file and using LoadResPicture. The .res file gets built into the .exe, and the bitmaps are saved in a standard format that any resource editor can read. If you load pictures at run time with the LoadPicture function, you must supply the picture files to your users along with your application.
------------------
Marty