Solved

Best way to load picture?

Posted on 1998-10-07
4
161 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

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

829 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