TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Re: Re: TW_IMAGEINFO

Forums › TWAIN Classic › TW_IMAGEINFO › Re: Re: TW_IMAGEINFO

July 16, 2013 at 9:35 pm #24482
si_ben
Participant
  • Topics - 7
  • Replies - 22
  • Total Posts - 29

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

Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • Hello world
  • Girls of Desire: All babes in one place, crazy, art
  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in