?
Solved

MSAccess - resize images using WIA

Posted on 2014-01-08
5
Medium Priority
?
480 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
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 …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

719 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