Link to home
Create AccountLog in
Avatar of dprager
dprager

asked on

Downzise picture size VBA code

Hi all,

I've programmed a access form that loads a picture into the piturebox. When I push the button the picture is saves as the primary key .jpg as from the selected record. The picture sizes are high resolution and between 1,5 and 2,5 MB in size. I only want to store pictures from maybe 40 to 60kb per picture. So now I use XnView to downsize them to a 640 x 480 pixel .jpg  image. it works great but can I do that in VBA as well when I store the picture.

Anyone any suggestion ?
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

dprager,

Use this program.
http://www.ammara.com/

It will make the image size as small as possible while still maintaining the original image quality.
(It does this by storing the images a "BLOBS" (B)inary (L)arge (O)(B)jects.)

So you would not need the extra step of using the external utility. (XnView).

The images will look better than if you reduced them manually.
The size in the images in the DB will be about 1/10 of what it would be if you reduced the file manually.

JeffCoachman
Avatar of dprager
dprager

ASKER

The quality of the picture isn't a real concern and I don't store the pictures in to the database. I store then in a folder on de C drive. That way I keep my database a lot smaller.
What I do not want is to use a othor program. What I would like is the VB code to change  the picture and maybe its color from 32 to maybe 16 bits and downzise the height and width to 640 x 480 pixels or maybe even the join pixel properties of the Jpeg.
Kinda like when you set a picture in to an HTML form and define the height and width the way you want it to be. I this case it just has to be stored of converted that way.

That is if it is possible. I'm not an expert so it has to be duable for a novice person. Otherwise i'll keep working with XN-view or ammara.
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
dprager,

Did XnView have an API?

JeffCoachman