Contact us


All times are UTC - 8 hours



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


Joined: Wed May 21, 2014 3:38 am
Posts: 19
I want to auto crop an image with the SetImageLayout method. When I set the Unit property to anything other than TWUN_INCHES, it throws a "Data value out of range, or of invalid type." exception. If I set IfThrowException to False then the default value of TWUN_INCHES is retained.

This is my code:

Code:
With dynamicDotNetTwainThumbnails
    .OpenSource()
    .IfThrowException = False
    .IfShowUI = False
    .PixelType = Enums.TWICapPixelType.TWPT_RGB
    .BitDepth = 24
    .IfDuplexEnabled = False
    .Resolution = 100
    .Unit = Dynamsoft.DotNet.TWAIN.Enums.TWICapUNits.TWUN_MILLIMETERS
    .SetImageLayout(0, 0, 100, 100)
    .AcquireImage()
End With


User avatar
Offline Profile  


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1701
Hi Matty,

There is no value of MILLIMETERS for Unit property.
Maybe you can set the property with other values, and check again.

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


Offline Profile  


Joined: Wed May 21, 2014 3:38 am
Posts: 19
There is definitely a TWUN_MILLIMETERS = 6 value appearing in my VS 2013 IDE. I am using .NET Twain 5.4.0.929. I can't see a way of posting a screen shot. I'll try emailing.


User avatar
Offline Profile  


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1701
Hi Matty,

Thank you for your feedback.

I got the screenshot from your email. I will inform our team to update the help doc.

I failed to reproduce the issue with Dynamic .NET TWAIN v5.4. Could you please provide me with more details? Or please contact our LiveChat team for instant help.

Thanks,

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


Offline Profile  


Joined: Wed May 21, 2014 3:38 am
Posts: 19
I replicated this with the .NET Twain demo project.

This displayed a message box with text "TWUN_INCHES".

Code:
dynamicDotNetTwain.Unit = Enums.TWICapUNits.TWUN_MILLIMETERS
MsgBox(dynamicDotNetTwain.Unit.ToString)


The message box displays "TWUN_INCHES" regardless of the value set for the Unit property.


User avatar
Offline Profile  


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1701
Hi Matty,

The issue was resolved by email.

FYI,

Quote:
The error message "Data value out of range, or of invalid type", it seems the device doesn't support this kind of unit. However, most devices support the TWUN_INCHES which is normally the default unit.

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ]  Moderators: Michael, Vincy


Who is online

Users browsing this forum: No registered users and 1 guest


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