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: 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? › Reply To: Saving image as the file format and TIF with delphi twain?

March 9, 2009 at 12:19 am #24822
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;

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

  • Big Ass Photos – Free Huge Butt Porn, Big Booty Pics
  • 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