Contact us


All times are UTC - 8 hours



Post new topic Reply to topic  [ 7 posts ] 
Author Message
Offline Profile  


Joined: Wed May 21, 2014 3:38 am
Posts: 19
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.


User avatar
Offline Profile  


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1683
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,

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


Offline Profile  


Joined: Wed May 21, 2014 3:38 am
Posts: 19
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?


User avatar
Offline Profile  


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1683
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.

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


Offline Profile  


Joined: Wed May 21, 2014 3:38 am
Posts: 19
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?


Offline Profile  


Joined: Wed May 21, 2014 3:38 am
Posts: 19
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?


User avatar
Offline Profile  


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1683
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.

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Copyright © 2016 Dynamsoft | All Rights Reserved
dynamic designed by Dynamsoft team