问题
How to use MediaCapture or DirectShow API in MS-Access? As WIA is outdated for cameras.
WIA examples exist but not MediaCapture or DirectShow
I almost never use VBA but need to capture a photo using Access 2013. I have found a .net example by MS that looks like it will do want I need, how to get it to work in VBA in Access?
' Using Windows.Media.Capture.CameraCaptureUI API to capture a photo
Dim dialog As New CameraCaptureUI()
Dim file As StorageFile = Await dialog.CaptureFileAsync(CameraCaptureUIMode.Photo)
MS says: WIA does not support cameras in Windows Vista or later. There are lots of good examples of how to use WIA with access, but am not finding anything for MediaCapture/DirectShow API
.net MediaCapture example:
Main File: CapturePhoto.xaml.vb in
https://code.msdn.microsoft.com/windowsapps/CameraCaptureUI-Sample-845a53ac/sourcecode?fileId=43599&pathId=1212418128
.net DirectShow example:
http://www.codeproject.com/Articles/671407/Camera-Net-Library
This explains how to make available in MS Access as a DLL: A Simple C# DLL - how do I call it from Excel, Access, VBA, VB6?
来源:https://stackoverflow.com/questions/32110648/how-to-use-take-a-photo-in-ms-access-in-vista-or-later-maybe-mediacapture-or-d