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

Reply To: How to dynamically determine scanned paper size

Forums › TWAIN Classic › How to dynamically determine scanned paper size › Reply To: How to dynamically determine scanned paper size

January 11, 2008 at 5:29 pm #24260
gabe
Participant
  • Topics - 9
  • Replies - 583
  • Total Posts - 592

my code (vb.net, but it shouldn’t be hard to translate) looks something like this:



Friend Function GetImageInfo() As Boolean
If TwState = 6 Then
Trace.WriteLine("Estimated Image Info")
End If
If TwState = 7 Then
Trace.WriteLine("Actual Image Info")
End If

Dim iinf As New DataStructures.twImageInfo()

If OperationTriplets.Image.ImageInfo.Get(iinf)=Enumerations.ReturnCode.Success Then
Trace.WriteLine("XResolution :" & iinf.XResolution.ToString)
Trace.WriteLine("YResolution :" & iinf.YResolution.ToString)
Trace.WriteLine("ImageWidth :" & iinf.ImageWidth.ToString)
Trace.WriteLine("ImageLength :" & iinf.ImageLength.ToString)
Trace.WriteLine("SamplesPerPixel :" & iinf.SamplesPerPixel.ToString)
Trace.WriteLine("BitsPerSample :" & iinf.BitsPerSample.ToString)
Trace.WriteLine("BitsPerPixel :" & iinf.BitsPerPixel.ToString)
Trace.WriteLine("Planar :" & System.Enum.GetName(GetType(Enumerations.PlanarChunky), iinf.Planar))
Trace.WriteLine("PixelType :" & System.Enum.GetName(GetType(Enumerations.PixelType), iinf.PixelType))
Trace.WriteLine("Compression :" & System.Enum.GetName(GetType(Enumerations.Compression))

Return True
Else
Return False
End If

End Function

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

  • 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
  • Failed to create TWAIN progress! Error code is 1260.
  • To get the list of scanners from javascript client side (browser)
  • 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