Solved

Downzise picture size VBA code

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

895 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now