Solved

MSAccess - resize images using WIA

Posted on 2014-01-08
5
451 Views
Last Modified: 2014-01-08
I have been researching WIA for hours, but haven't found what I'm looking for - lots of info on devices and image acquisition, etc., but nothing helpful on basic scaling. I have a number of gifs in a folder that I need to scale by 60% and save to a new filename. Can anybody point me to a source that explains how to do this with WIA? I have the WIA library referenced in my module, but I haven't found a clear description of WIA methods and properties, or how to use them in VBA. Some examples would be helpful.
0
Comment
Question by:dgmoore1
  • 3
  • 2
5 Comments
 
LVL 19

Expert Comment

by:Ken Butters
ID: 39765446
This link is to MS site for scaling within WIA

http://msdn.microsoft.com/en-us/library/windows/desktop/ms630819(v=vs.85).aspx#itemScale

you must use a filter in order to manipulate the image.  The link above gives a code example of how to scale the image.

Their example creates a thumbnail image from a bmp file (100pixels by 100 pixels)
0
 

Author Comment

by:dgmoore1
ID: 39765521
Is there a way to scale by percentage rather than pixel height and width?
0
 

Author Comment

by:dgmoore1
ID: 39765537
Or, alternatively, a way to get the pixel height and width and calculate the desired new values?
0
 
LVL 19

Accepted Solution

by:
Ken Butters earned 500 total points
ID: 39765675
You should be able to use these properties of the image:


      oldWidth = img.width
      oldHeight = img.height

or in your case...

  newWidth = img.width * 0.6
  newHeight = img.height * 0.6
0
 

Author Closing Comment

by:dgmoore1
ID: 39765991
Just what I needed - thanks!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

707 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

13 Experts available now in Live!

Get 1:1 Help Now