Dynamsoft Document Imaging SDKs
http://forums.dynamictwain.com/

Webcam image doesn't fill dynamic twain window
http://forums.dynamictwain.com/webcam-image-doesn-t-fill-dynamic-twain-window-t5633.html
Page 1 of 1

Author:  Matty [ Thu May 22, 2014 5:11 pm ]
Post subject:  Webcam image doesn't fill dynamic twain window

I am using the following code to make the captured webcam image fill the dynamic twain control window:

dynamicDotNetTwain1.SupportedDeviceType = EnumSupportedDeviceType.SDT_WEBCAM
dynamicDotNetTwain1.SetViewMode(-1, -1)

This works as expected on my development machine but when I deployed the application to another workstation, there was a significant amount of white space around the image. Can you think of why there may have been a difference with this behaviour on the 2 workstations.

Author:  Vincy [ Sun May 25, 2014 7:11 pm ]
Post subject:  Re: Webcam image doesn't fill dynamic twain window

Hi Matty,

Thank you for contacting us.

For your issue, may I ask if you use the same webcam for the two situation.

Normally, white space indicates the ratios of length and width of image you acquired doesn't match that of our control.

If you are using webcams of the same type, you can adjust the length and width of our control to fit the image.

If not, it is suggested to set DynamicDotNetTwain.FitWindowType Property to make the image fit the window size. Please refer to:
http://www.dynamsoft.com/help/TWAIN/.Net-TWAIN-Scanner/html/P_Dynamsoft_DotNet_TWAIN_DynamicDotNetTwain_FitWindowType.htm

If you have any further question, please feel free to let me know.

Regards,

Author:  Matty [ Wed Jun 17, 2015 7:55 pm ]
Post subject:  Re: Webcam image doesn't fill dynamic twain window

I would like to revisit this issue. My video container and dotnet twain control sizes are both set to 500 x 500. When I activate the video container, there are no scroll bars. When I capture an image from the webcam and display it in the dotnet twain control, the image width is larger than its height and scroll bars appear at the bottom of the window to access the part of the image that is no longer visible to the right of screen. If I set FitWindowType to DWTFitWindowType.enumFitWindow instead of DWTFitWindowType.enumFitWindowHeight, white space appears above and beneath the image. I want a perfectly square image to be captured exactly as it appears in the video container window. How can I achieve this?

Author:  Vincy [ Thu Jun 18, 2015 1:42 am ]
Post subject:  Re: Webcam image doesn't fill dynamic twain window

Hi Matty,

Regarding the picture size issue. Please check if the scanned image is perfectly square. If so, you can set the ViewMode to -1 by -1 to see how it works.

Author:  Matty [ Thu Jun 18, 2015 6:30 am ]
Post subject:  Re: Webcam image doesn't fill dynamic twain window

I am setting the view mode to -1 x -1. How do I check the dimensions of the captured image? Is there an easy way of cropping equal amounts off each side such that the width and height are equal?

Author:  Matty [ Thu Jun 18, 2015 7:55 pm ]
Post subject:  Re: Webcam image doesn't fill dynamic twain window

Essentially what I want here is for the captured image displayed in the .NET Twain control window to be identical in size and appearance to the image that was displayed in the video container (picture box) at the time of snapping the photo. Both the video container picture box and the .NET Twain control are perfect squares. Why is the .NET Twain control widening the photo and placing scroll bars at the bottom?

Author:  Vincy [ Fri Jun 19, 2015 1:16 am ]
Post subject:  Re: Webcam image doesn't fill dynamic twain window

Hi Matty,

For the captured image, you can check the ImageLength and ImageMargin property.

What resolution value did you use for image capture? You can refer to this API or check setting in the pop-up video container. For example, if your webcam’s resolution is set to 640 x 640, the captured image should be perfectly squared; if you try 1280 x 678, then it is impossible to get a perfectly square image unless you crop it. Besides, the image shown in the video container always fits the window.

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/