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

JTwain and page frames

Forums › TWAIN Classic › JTwain and page frames

  • This topic has 1 reply, 2 voices, and was last updated 15 years, 1 month ago by mmotovsk.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 8, 2005 at 3:00 pm #21812 Reply
    jtwainuser
    Participant
    • Topics - 1
    • Replies - 0
    • Total Posts - 1

    I’m developing a java applet that must retrieve an image from a scanner. I’m using the JTwain libraries to connect to my scanning device and acquire the image. The only problem is that the scanner retrieves the entire scanning area, while all I want is just a subset of that (a frame), exaclty the top-left corer (in px, width=210, height=237). User Interface is disabled. This is a piece of code:

    …
    selectedSource.open();
    selectedSource.setUnits(JTwainConstants.TWUN_PIXELS);
    selectedSource.setXResolution(200.0);
    selectedSource.setYResolution(200.0);
    selectedSource.setUIEnabled(false);
    ValueContainerOneValue valuePixelType = new ValueContainerOneValue();
    valuePixelType.setItem(new ItemTypeInteger(Source.TWTY_UINT16, JTwainConstants.TWPT_RGB));
    selectedSource.setCapability(Source.ICAP_PIXELTYPE, valuePixelType);
    acquiredImage = selectedSource.acquireImage();
    selectedSource.close();
    …

    How can I handle that?
    ________
    Honda Rc171

    November 22, 2005 at 9:36 pm #23152 Reply
    mmotovsk
    Participant
    • Topics - 3
    • Replies - 13
    • Total Posts - 16

    I am not familiar with JTwain, but I know API of the Morena – Image Acquisition Framework for Java™ Platform. It has
    setFrame(double left, double top, double right, double bottom) method. Your described communication in Morena API is as follows:

    …
    source.setUnits(TwainConstants.TWUN_PIXELS);
    source.setXResolution(200);
    source.setYResolution(200);
    source.setPixelType(TwainConstants.TWPT_RGB);
    source.setFrame(0,0,210,237);
    image=Toolkit.getDefaultToolkit().createImage(source);

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: JTwain and page frames
Your information:




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

  • 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
  • Failed to create TWAIN progress! Error code is 1260.
  • 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

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.