?
Solved

Best way to load picture?

Posted on 1998-10-07
4
Medium Priority
?
164 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 300 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
In this tutorial viewers will learn how to create blended and gradiated shapes in Illustrator using the blend tool Draw two shapes, one of them in a different color: Select both and create a blend by going to Object > Blend > Make: Blends can also b…
In addition to being a great web-based presentation tool, Prezi also makes it easy to save your presentation as a PDF to share with others as well. Learn how in this tutorial. Select the share icon from the top menu in your Prezi editor: Select "D…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 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