Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MSAccess - resize images using WIA

Posted on 2014-01-08
5
Medium Priority
?
486 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 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

972 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