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

Saving image as the file format and TIF with delphi twain?

Forums › TWAIN Classic › Saving image as the file format and TIF with delphi twain?

  • This topic has 2 replies, 3 voices, and was last updated 11 years, 10 months ago by Benedictum.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 2, 2009 at 7:37 pm #22469 Reply
    leywander
    Participant
    • Topics - 1
    • Replies - 0
    • Total Posts - 1

    I am using a component DelphiTwain for acquisition of the image scanner, but can only save as BMP.
    I would save the images in TIFF and JPG.
    If someone knows what to do I appreciate in show ….!

    March 5, 2009 at 6:34 am #24821 Reply
    gabe
    Participant
    • Topics - 9
    • Replies - 583
    • Total Posts - 592

    How do you feel about using a different component for image manipulation?
    I won’t pretend to know Delphi, but there must be a ton of general purpose libs available for converting bmp to xyx. If I was certain that ImageMagik has a Delphi port I would recommend it, otherwise I would look outside of the twain spec for a general purpose image manipulation library.

    .

    March 9, 2009 at 12:19 am #24822 Reply
    Benedictum
    Participant
    • Topics - 3
    • Replies - 11
    • Total Posts - 14

    Here is link to use Delphi’s TJpegImage component. Here is what I did:
    http://articles.techrepublic.com.com/5100-10878_11-5031886.html

    jImage:TJpegImage; // declared in the unit header

    procedure TMainForm.TwainTwainAcquire(Sender: TObject; const Index: Integer;
    Image: TBitmap; var Cancel: Boolean);
    var
    mStream: TMemoryStream;
    bImage: TBitMap;
    begin
    // Convert Image to jpeg
    mStream := TMemoryStream.Create;
    bImage := TBitmap.Create;
    jImage.Empty;
    jImage.compressionQuality := jComp; // compression – ignore if not needed

    // assign and convert to grayscale
    jImage.assign(Image); // image is the bitmap acquired
    jImage.Compress; //
    jImage.Grayscale := true; // I do not need the color –
    // convert back to bmp so that
    // I can display on the TImage panel

    bImage.Assign(jImage);
    // and display in TImage
    Image1.Picture.Assign(bImage);

    end;

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Saving image as the file format and TIF with delphi twain?
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

  • 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

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.