Solved

Best way to load picture?

Posted on 1998-10-07
4
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
In this second Micro Tutorial in the series,  viewers will learn more basic shortcuts and functions of Illustrator. In this tutorial you will learn about the eyedropper tool, zoom , ellipses and more.
Not only does Prezi allow you to create non-linear presentations, it also makes it easy to apply transition animations between your frames. Learn how to apply a fade-in transition to select items and entire frames in this tutorial Select "Edit Path"…

691 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