Solved

Downzise picture size VBA code

Posted on 2008-06-10
4
920 Views
Last Modified: 2013-11-27
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 ?
0
Comment
Question by:dprager
  • 3
4 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21756777
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
0
 
LVL 1

Author Comment

by:dprager
ID: 21778464
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.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 250 total points
ID: 21780870
dprager,

Check with XnView and see if they provide an "API" (Application Programming interface)
This will allow you to use VBA to control  XnView.

JeffCoachman
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 21867054
dprager,

Did XnView have an API?

JeffCoachman
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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