Getting error in setting image layout

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
BillG
Posts: 47
Joined: Fri Oct 10, 2008 3:52 pm

Getting error in setting image layout

Post by BillG » Sun Jan 18, 2009 11:46 pm

vsTwain1.OpenDataSource();
vsTwain1.UnitOfMeasure = UnitOfMeasure.Inches;
vsTwain1.Brightness = vsTwain1.BrightnessMaxValue;
vsTwain1.SetImageLayout(1, 1, 6, 4);

I am trying to scan a card that is 6 inches and 4 inches wide and am getting an error in setting the image. What am I doing wrong?

Bill

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Getting error in setting image layout

Post by Alex » Tue Jan 20, 2009 5:44 pm

Hi Bill,

Maybe your scanner does not support image layout feature? Please send a log file generated by the library to our support team at support@vintasoft.com.

Best regards, Alexander

ljones
Posts: 2
Joined: Wed Jun 17, 2009 11:18 am

Re: Getting error in setting image layout

Post by ljones » Wed Jun 17, 2009 11:26 am

I too am getting the same error I presume the scanner does have capability to be able to do this since the error does not say "Capability is not supported." (as it does for set pagesize) - Here is the code at which it errors and the last few lines of my log file:

VsTwain1.SetImageLayout(0, 0, 3, 4)

17/06/2009 09:15:38 PTW90-5
17/06/2009 09:15:39 PTW2 msg=0xf (WM_PAINT) hwnd=0xb0bac wparam=0x0 lparam=0x0 result=0x0
17/06/2009 09:15:39 PTW90-5
17/06/2009 09:15:39 PTW2 msg=0xf (WM_PAINT) hwnd=0x20c48 wparam=0x0 lparam=0x0 result=0x0
17/06/2009 09:15:39 PTW90-5
17/06/2009 09:15:39 PTW2 msg=0x202 (WM_LBUTTONUP) hwnd=0xb0bac wparam=0x0 lparam=0x13002e result=0x0
17/06/2009 09:15:39 PTW90-5
17/06/2009 09:15:39 SetCap(258,5,0)
17/06/2009 09:15:39 SetCap result = 0
17/06/2009 09:15:39 GIL1
17/06/2009 09:15:39 GIL2 0
17/06/2009 09:15:39 GIL3 1 1 1 0 0 8.5 14
17/06/2009 09:15:39 SIL1 0 0 3 4
17/06/2009 09:15:39 SIL2
17/06/2009 09:15:39 SIL3 2


many thanks

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Getting error in setting image layout

Post by Alex » Wed Jun 17, 2009 1:27 pm

Hello,

Are you sure that you have set inches as unit of measure?

Your device has sent extended information about problem with image layout to application. Please download latest version (5.0.3.5) of VintaSoftTwain.NET Library from our site, generate new log file and send it to support@vintasoft.com.

Best regards, Alexander

ljones
Posts: 2
Joined: Wed Jun 17, 2009 11:18 am

Re: Getting error in setting image layout

Post by ljones » Wed Jun 17, 2009 3:22 pm

Yes I am sure it is in inches, i set them to inches and then Got layout to see what the current size was during debug.

VsTwain1.UnitOfMeasure = UnitOfMeasure.Inches
Dim lay As String = VsTwain1.GetImageLayout()
VsTwain1.SetImageLayout(0, 0, 3, 4)


Can you link where i ought to download the new version? I have bought the version 5.0.3.3 , and i can only see a download for the evaluation dll.

However I will still send you the 5.0.3.3 log file.

many thanks

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Getting error in setting image layout

Post by Alex » Thu Jun 18, 2009 8:09 am

Hello,

You can download the latest version of VintaSoftTwain.NET Library from this link: http://www.vintasoft.com/zip/VSTwainNet50.zip

Best regards, Alexander

pikarde
Posts: 5
Joined: Wed Jun 24, 2009 5:44 pm

Re: Getting error in setting image layout

Post by pikarde » Wed Jun 24, 2009 6:43 pm

I have the same problem. Error when setting image layout.

here is my code:
VSTwain1.OpenDataSource()
VSTwain1.Resolution = 150
VSTwain1.PdfImageCompression = PdfImageCompression.Auto
VSTwain1.PixelType = PixelType.GRAY
VSTwain1.UnitOfMeasure = UnitOfMeasure.Inches
VSTwain1.SetImageLayout(0, 0, 8.5, 11)
VSTwain1.Acquire()

here is the twain log
TWAIN_32.DLL - MESSAGE - CTwunk ::AppInitialize - Reset Log
TWAIN_32.DLL - MESSAGE - CTwunk ::OpenServer - Starting Thunker
TWAIN_32.DLL - MESSAGE - CTwunk ::CloseServer - Why Can't We Find The Thunker Window?
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to NULL:
TWAIN_32.DLL - MESSAGE - CTWTRACE--CONTROL, IDENTITY, GETFIRST
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to NULL:
TWAIN_32.DLL - MESSAGE - CTWTRACE--CONTROL, IDENTITY, GETNEXT
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 7, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to NULL:
TWAIN_32.DLL - MESSAGE - CTWTRACE--CONTROL, IDENTITY, GETDEFAULT
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to NULL:
TWAIN_32.DLL - MESSAGE - CTWTRACE--CONTROL, IDENTITY, OPENDS
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to WIA-Brother MFC-8220 USB(3):
TWAIN_32.DLL - MESSAGE - CTWTRACE--CAPABILITY, GET, XRESOLUTION
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to WIA-Brother MFC-8220 USB(3):
TWAIN_32.DLL - MESSAGE - CTWTRACE--CAPABILITY, SET, XRESOLUTION
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to WIA-Brother MFC-8220 USB(3):
TWAIN_32.DLL - MESSAGE - CTWTRACE--CAPABILITY, GET, YRESOLUTION
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to WIA-Brother MFC-8220 USB(3):
TWAIN_32.DLL - MESSAGE - CTWTRACE--CAPABILITY, SET, YRESOLUTION
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to WIA-Brother MFC-8220 USB(3):
TWAIN_32.DLL - MESSAGE - CTWTRACE--CAPABILITY, GET, PIXELTYPE
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to WIA-Brother MFC-8220 USB(3):
TWAIN_32.DLL - MESSAGE - CTWTRACE--CAPABILITY, SET, PIXELTYPE
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to WIA-Brother MFC-8220 USB(3):
TWAIN_32.DLL - MESSAGE - CTWTRACE--CAPABILITY, GET, UNITS
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to WIA-Brother MFC-8220 USB(3):
TWAIN_32.DLL - MESSAGE - CTWTRACE--CAPABILITY, SET, UNITS
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to WIA-Brother MFC-8220 USB(3):
TWAIN_32.DLL - MESSAGE - CTWTRACE--IMAGE, IMAGELAYOUT, SET
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 2, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to WIA-Brother MFC-8220 USB(3):
TWAIN_32.DLL - MESSAGE - CTWTRACE--CONTROL, EVENT, PROCESSEVENT...
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 5, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to NULL:
TWAIN_32.DLL - MESSAGE - CTWTRACE--CONTROL, IDENTITY, CLOSEDS
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = 0)
TWAIN_32.DLL - MESSAGE - CTWTRACE--VintaSoftTwain.NET(2) to NULL:
TWAIN_32.DLL - MESSAGE - CTWTRACE--CONTROL, PARENT, CLOSEDSM
TWAIN_32.DLL - MESSAGE - DSM --DsmEntryDiagExit (RC = 0, CC = FFFF)

This is the capabilities list:
==========================================

Data Source information
Manufacturer: Brother
Product family: Twain Data Source On WIA
Product name: WIA-Brother MFC-8220 USB
TWAIN version: 1.9
TWAIN 2.0 compatible: False
Flatbed present: True
ADF present: True

Current pixel type: Gray
Supported pixel types: BW, Gray

Current resolution: 100 dpi
Supported resolutions: 100, 150, 200, 300, 400, 500, 600, 1200

Current page size: None

Current unit of measure: Inches
Supported units of measure: Inches, Pixels

Current image layout in Inches: (0; 0) - (8.5; 14)

==========================================

Data Source capabilities:

XferCount (read/write)
Current value: 0

ICompression (read/write)
Current value: 0
Supported values: 0

IPixelType (read/write)
Current value: 1
Supported values: 0, 1

IUnits (read/write)
Current value: 0
Supported values: 0, 5

IXferMech (read/write)
Current value: 0
Supported values: 0, 1, 2

FeederEnabled (read only)
Current value: 0

FeederLoaded (read/write)
Current value: 1

SupportedCaps (read only)
Supported values: 1, 256, 257, 258, 259, 4098, 4099, 4101, 4103, 4107, 4110, 4111, 4116, 4353, 4355, 4364, 4369, 4370, 4374, 4375, 4376, 4377, 4380, 4383, 4384, 4387, 4388, 4389, 4395

AutoFeed (read/write)
Current value: 0

Indicators (read/write)
Current value: 1

UIControllable (read/write)
Current value: 1

DeviceOnline (read/write)
Current value: 1

EnableDsUiOnly (read/write)
Current value: 0

IBrightness (read/write)
Current value: 1.525879E-05
Default value: 0
Range of supported values: min = -1000, max = 1000, step size = 1

IContrast (read/write)
Current value: 1.525879E-05
Default value: 0
Range of supported values: min = -1000, max = 1000, step size = 1

IImageFileFormat (read/write)
Current value: 2
Supported values: 2, 6

IPhysicalWidth (read/write)
Current value: 8.5

IPhysicalHeight (read/write)
Current value: 14

IXNativeResolution (read/write)
Current value: 300

IYNativeResolution (read/write)
Current value: 600

IXResolution (read/write)
Current value: 100
Supported values: 100, 150, 200, 300, 400, 500, 600, 1200

IYResolution (read/write)
Current value: 100
Supported values: 100, 150, 200, 300, 400, 500, 600, 1200

IBitOrder (read/write)
Current value: 1
Supported values: 1

IPixelFlavor (read/write)
Current value: 0
Supported values: 0, 1

IPlanarChunky (read/write)
Current value: 0

IThreshold (read/write)
Current value: 128
Default value: 128
Range of supported values: min = 0, max = 255, step size = 1

IXScaling (read/write)
Current value: 1
Default value: 1
Range of supported values: min = 1, max = 1, step size = 1

IYScaling (read/write)
Current value: 1
Default value: 1
Range of supported values: min = 1, max = 1, step size = 1

IBitDepth (read/write)
Current value: 8
Supported values: 1, 8





Thanks for the help.

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Getting error in setting image layout

Post by Alex » Wed Jul 01, 2009 8:20 am

Hello,

Please try to use TWAIN driver for your scanner, WIA drivers is not 100% compatible with TWAIN specification.

Best regards, Alexander

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests