Solved

Downzise picture size VBA code

Posted on 2008-06-10
4
923 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

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

733 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