Solved

Downzise picture size VBA code

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
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…

708 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

16 Experts available now in Live!

Get 1:1 Help Now