Windows Image Acquisition (WIA) Taking black photos

  • Thread starter Roberto Hernández
  • Start date
R

Roberto Hernández

I try to use the Windows Image Acquisition (WIA) with a sample in vb.net but
it takes only back photos and also at low resolution. How can I put ther
resolution at 640x480?
I have a Labtec webcam plus that works fine with other software.
I downloaded two samples from the internte and both of them do the same
problem
The samples are:
http://www.vbforums.com/showthread.php?t=378126
http://www.vbforums.com/attachment.php?attachmentid=44367
and
http://msdn.microsoft.com/coding4fun/someassemblyrequired/lookatme/default.aspx
http://download.microsoft.com/download/d/4/5/d4556729-81f9-4578-936a-111721b27e49/BlogWebcam-VB.msi

Thanks.
 
P

Peter Huang [MSFT]

Hi Roberto,

Have you tried the WebCam with the Window Explorer?
If you attach the web cam onto the machine, there should be an icon in the
Explorer, My Computer.
Double click that icon and take photo to see what is the result.

Please perform the test and let me know.

Or you may try to use another Web Cam, e.g. the Logitech to see if the code
in the sample works.
Take a photo.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wiaaut/wia/
wiax/overviews/sharedsamples.asp

Based on my test, if we use a logitech webcam the result will be the same
as we do in the Windows Explorer.

Also to use WIA in VB.NET we need to install the Windows Image Acquisition
Automation Layer which is a wrapper.
Windows Image Acquisition Automation Layer
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wiaaut/wia/
wiax/overviews/startpagewiaaut.asp

For low level control. I think you may try Windows Image Acquisition (WIA)
directly which should be coding with C++.

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
R

Roberto Hernández

With Windows Explorer works very good but only at 352x288 and not 640x480
I also try the VB6 sample you put in
http://msdn.microsoft.com/library/d...s/wiaaut/wia/wiax/overviews/sharedsamples.asp
but it do the same, balck photos. I can see the mix photos in the Windows
Explorer the pictures taken by the VB aplication are balck and the others
good.
I have to change a line in the VB6 code "CameraDeviceType" by
"VideoDeviceType" Because it detected it as VideoDeviceType.

If dev.Type = VideoDeviceType Then 'CameraDeviceType
Dim itm 'As Item
Set itm = dev.ExecuteCommand(wiaCommandTakePicture)
End If

Thanks.
 
P

Peter Huang [MSFT]

Hi Roberto,

I think you may try to use another WebCam to see if the problem persists.
So that we can isolate if the problem is environment specific.
e.g.
WebCam A will work with machine A well, so if we attach the WebCam A onto
the problem machine, what is the result?
or
You may try your WebCam on another machine to see if that works fine. If
yes, I think we can know the problem maybe machine specific.
You may try the hardware from the list below.
http://testedproducts.windowsmarketplace.com/results.aspx?bCatID=761&cpID=0&
ocID=0&OR=1

Since I have tried with the sample code with a logitec webcam and I can not
reproduce the problem.
So I think the code should be OK.

Also since the problem persisted with Visual Basic 6 which is an unmanaged
code, I think the problem may be hardware or driver related.
I think you may try the newsgroup below.
microsoft.public.win32.programmer.mmedia

Best regards,

Peter Huang

Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top