1,105,333 Community Members

reduce the size of the saved picture from vb6 Picturebox

Member Avatar
neosonic
Junior Poster
138 posts since Nov 2009
Reputation Points: 12 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 2 [?]
 
0
 

Hi,

I wrote a drawing tool program by using vb6.
I scans a big house plan (A3 size) and load many little pictures as the element of the house.
The user can manipulate the house plan and saved it back.

I used normal vb6 method to load and save the picture, by using loadpicture and savepicture method. My problem is the saved picture is as large as 5 mb and the load picture requires very big amount of graphic memory and it will cause "out of memory" error whenever the computer doesn't have enough memory to start it. It takes up to 1 minute for a fast computer to load, and that is very slow.

Also I have a memory leak problem, although I have called loadpicture = "" whenever I want to "unload" picture from the picturebox whenever I close the form. I have close all the database recordset that I opened too.

I makes me need to restart my computer for every 3 times of the program executions because I will have out of memory problem for the 4th time.

Is there any third party program? or any suggestions to reduce the saved image size and to load the picture more efficiently?

Thanks.

Member Avatar
JeffBennett
Newbie Poster
11 posts since Dec 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 


Is there any third party program? or any suggestions to reduce the saved image size and to load the picture more efficiently?

The problem is that VB 6 SavePicture always saves uncompressed images ( BMP )
One option is to save the picture in a compressed format like JPG, GIF, PNG.
There are several OCX components you can use in your VB 6 application to do this.

Here are a couple
ImageMan - by Data Techniques
http://www.data-tech.com/
This may be very useful for you because it has image scanning built in
and the ability to adjust the scanned image - crop, adjust brightness
adjust contrast, rotate ( in case the image was scanned at an angle)..
Also you can read and write a very large number of image format
Image Man is very reliable and has been around for a long time.


MetaDraw - by Bennet-Tec Information Systems
http://www.www.Bennet-Tec.com/
First let me be up front - this component is produced by my company.
That said, MetaDraw may be of interest to you because it will
not only support saving to GIF, JPG, PNG, but it is also ideal
for your application in terms of allowing users to move objects
around within a drawing canvas. You already seem to have that
part of your application built, but you may find MetaDraw helpful
in that in addition to storing in compressed formats as noted above
you can also store in MetaDraw MDP format that will allow reloading and
still recognize the independent parts of the image so user can continue
to drag objects around after reloading. Unfortunately the MDP
format is not compressed so you might use GIF, JPG, or PNG
for save to publish, and MDP for Save for editing.

There are many other OCX components for VB 6 out there to support compression.
Another is Lead Tools www.leadtools.com/sdk/compression, just search on Google and you'll find many.


I hope this is helpful

Jeff Bennett

* Bennet-Tec Information Systems, Inc
* www.Bennet-Tec.Com

RELIABLE Component Software
and Custom Software Development Services

TList™ / ALLText™ / MetaDraw™ / Web Signature™

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: