Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Taking a Picture with MS WIA

Posted on 2014-11-25
9
Medium Priority
?
169 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
[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
  • 4
  • 3
  • 2
9 Comments
 
LVL 58
ID: 40466688
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 58
ID: 40466693
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 58
ID: 40466697
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 26

Accepted Solution

by:
Nick67 earned 2000 total points
ID: 40467230
@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
 
LVL 58
ID: 40467300
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
ID: 40467459
@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
ID: 40470896
Hi Nick67,
Thank You for your efforts, your contribution and for sharing your hard work.
Kindest Regards,
Mohamed
0
 

Author Comment

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

Expert Comment

by:Nick67
ID: 40470904
@Mohamed.

Your welcome.  I hope it serves the purpose.

Nick67
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

670 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