Home › Forums › TWAIN Classic › TW_IMAGEINFO › Re: Re: TW_IMAGEINFO
TW_IMAGEINFO can only be Requested. Each Capability has to be set manually
I haven’t figured this out yet but I’m assuming its around the lines….
This is what your IMAGE INFO should look like…
[StructLayout(LayoutKind.Sequential, Pack = 2)]
internal class TwImageInfo
{ // TW_IMAGEINFO
public int XResolution;
public int YResolution;
public int ImageWidth;
public int ImageLength;
public short SamplesPerPixel;
// Initialized to 8 Bits (Constant)
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public short[] BitsPerSample;
public short BitsPerPixel;
public short Planar;
public short PixelType;
public short Compression;
}
Using this — you would need these capabilities declared
(OF Type ‘TwCap’)
ICompression = 0x0100
IPixelType = 0x0101
IBitDepth = 0x112b
IXResolution = 0x1118
IYResolution = 0x1119
(I think there is one called IPhysicalHeight, IPhysicalWidth) Still converting.
Then what you would do is use the Triplet :
FIRST You need to get the Memory Location so you use GET
‘cap is set to TypeOf(IBitDepth)
(appid, appid, Control, Capability, Get, cap);
‘change it to what you want it to be –> Then
(appid, appid, Control, Capability, Set, cap);
__________________________________________________________________
This is how I understand it. There is some MemLock and Release in there somewhere, I’m still learning the process here too, If anyone can improve upon this answer or at least make it what it should be, I could sure use the help as well
Ben @ Software Innovations