Solved

MSAccess - resize images using WIA

Posted on 2014-01-08
5
465 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

830 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