Solved

Best way to load picture?

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Learn the basics of inputting and editing your text components in Prezi. We will cover how to set styles, position, and group your text components. In your Prezi editor, click anywhere on the canvas to add text: A flashing cursor informs you that yo…

760 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

18 Experts available now in Live!

Get 1:1 Help Now