Solved

Best way to load picture?

Posted on 1998-10-07
4
159 Views
Last Modified: 2013-11-19
I use a lot of BMP file. I am loading the BMP files at run time. This requires all the BMP file in the proper place and I have to carry them when I switch computer. Any better way?
I appreciate step-by-step instructions.
0
Comment
Question by:yushimi
4 Comments
 
LVL 2

Accepted Solution

by:
schild earned 150 total points
ID: 1438601
use the image list, its created for that.
Press <CTRL-T> and you will get the components dialog box.
Over there found the "Microsoft Window Common cotrol 5.0"
mart it.
Then you will see eight more control at toolbox window.
Choose the "ImageList" and it to one of your forms.
select it and then press right mouse botton.
Choose the "properties" option
inside the dialog box you will see an "Insert" botton, then add your bitmaps as much as you want to.
For each bitmat you can fix a "key" value, which can be a string, FIX a key, without it you will be lost!!!

Now you want to load one of the pictures, let say yout want to load the "Baloon" pictur in Run time into "Picture1"

set Picture1.Picture = ImageList1.ListImages("Baloon").Picture

Thats all

Good Luck
schild

BTW.
I almost forgot the "Ballon" is the "Key" value you fixed in the image list just after you load the baloon picute inside it.

0
 
LVL 1

Expert Comment

by:EvanL
ID: 1438602
First problem is that .bmp files are not compressed naturally, so their file sizes are always much larger than a similar looking .jpg file.  I would suggest converting all of your bitmaps to jpegs.  You can do this for free by downloading PaintShop Pro from the net (for free) and opening each .bmp and saving as a .jpg.  The other way to get smaller file sizes for your graphics is to convert the .bmps to low color .gifs.  A typical conversion of a 600kb bitmap to a 256 color gif would make a 60kb file size.  By not using .bmps, you can also have the ability to move the files around better.

If you must use .bmps for some reason, I would suggest going to www.activex.com and looking for an activex control that zips and unzips from within your VB project/application.  It would probably take longer to read the graphics, but should work.  Really, converting your graphics to .jpgs is the best idea, because the compression is automatic and transparent to you without having to use zip compression.

As far a moving the files is concerned, you will have to move them around with you.  It sounds like you have some manner of picture database.  And as with a normal DB, you have to have the data file with you when you run the application.

Best,

EvanL
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1438603
ImageList has the restriction that all images be the same size.

M
0
 

Expert Comment

by:stingray
ID: 1438604
check out using resource file.  you can place all your bmp,wav,text item into the file then retrieve them using an index.  The resource file is then compiled right into your program.

This is faster than reading the files from your drive.  Although jpg files are smaller, they take longer to load, because they must be decompressed.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Add visuals to your Prezi to keep your audience engaged. Learn how to embed images, edit them, and more in this video micro tutorial. Select "Insert" from the top menu in your Prezi editor: Select "Image": A toolbar will pop in from the right …

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now