Solved

MSAccess - resize images using WIA

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

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

623 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