Solved

Taking a Picture with MS WIA

Posted on 2014-11-25
9
156 Views
Last Modified: 2014-11-28
Hi,

Using WIA (or it's replacement), how can I take a picture and show this in an MS Access form and report ?
imgPic on frmPictures has tblPictures.PicFilePathAndName as its control source.

Your assistance is greatly appreciated.

Kind Regards,
Mohamed
0
Comment
Question by:Mohamed Singh
  • 4
  • 3
  • 2
9 Comments
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
Rather than deal with low level WIA calls, you might want to purchase a control:

http://www.ammara.com/support/samples/access-wia-camera-control.html

Jim.
0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
and by the way, depending on what your doing, dealing with the WIA object library directly may not be all that hard.  For example, it might be as simple as this:

Dim commondialog1 As Object
Dim img As ImageFile
Set commondialog1 = CreateObject("wia.commondialog")
Set img = commondialog1.ShowAcquireImage

img.SaveFile ("c:\test.jpg")

Jim.
0
 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
I should add that on that link in the first comment, look at the very bottom and view the sample code for frmCapture

Some of it involves dealing with their control, but a lot of it shows you how to work with the WIA lib.

Jim.
0
 
LVL 26

Accepted Solution

by:
Nick67 earned 500 total points
Comment Utility
@Jim

There are no longer any webcams that have WIA drivers, regrettably.
MS decided DirectShow should be the webcam's driver of choice -- but VBA has no DirectShow support.
That leaves WinAPI if you want a free, and freely distributable solution.

Like the sample attached :)

The sample is ROUGH.
It depends upon a working webcam being installed, and the folder c:\temppdf existing and being freely available.
frmPicParameters has two textboxes.
Enter the number of milliseconds you'd like between snapshots in the LOWER textbox. The upper is used to indicate that the app is active.
frmView is pointed at the images that get blown into c:\temppdf

Since this was for my own use only, I haven't sewn up the niceties
c:\temppdf must be empty
The webcam must exist and not being use by other applications
The error messages when things go BANG! are quite grievous, but the app works

Nick67
SnagImages-v2.mdb
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 57

Expert Comment

by:Jim Dettman (Microsoft MVP/ EE MVE)
Comment Utility
He just said he wanted to take a picture...not sure it will be from a webcam.

Jim.
0
 
LVL 26

Expert Comment

by:Nick67
Comment Utility
@Jim
:)
He's read my WIA articles and asked for this in an unrelated Q
http://www.experts-exchange.com/Database/MS_Access/Q_28566220.html
The phrasing there was using WIA to take a pic (using an attached camera/webcam)

Way back, I worked with point-and-shoots that, when jacked in with USB, could be triggered to take a picture.
None of the point-and-shoots in the outfit now (various models of Canon PowerShots) have that ability anymore.
Do you know of any?
0
 

Author Closing Comment

by:Mohamed Singh
Comment Utility
Hi Nick67,
Thank You for your efforts, your contribution and for sharing your hard work.
Kindest Regards,
Mohamed
0
 

Author Comment

by:Mohamed Singh
Comment Utility
Hi Jim,
Thank You for participating.
I will definitely keep DBPix in mind.
Kind Regards,
Mohamed
0
 
LVL 26

Expert Comment

by:Nick67
Comment Utility
@Mohamed.

Your welcome.  I hope it serves the purpose.

Nick67
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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

743 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

12 Experts available now in Live!

Get 1:1 Help Now