Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6622997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:28:47+00:00 2026-05-25T21:28:47+00:00

I am using the WIA 2.0 library within Delphi XE to automate scanning. I

  • 0

I am using the WIA 2.0 library within Delphi XE to automate scanning. I am using the “ShowAcquireImage” function to provide an image to be saved to disc. I want to save the image in a compressed format such as png or jpg, but the library only seems to save in bitmap.

Has anyone else seen this problem, and is there a workround? (Apart from saving to disc as a big bmp file, and re-loading into a TJpegImage/TPngImage object, that is).

Thanks for any advice
PhilW.

This the code I am currently using:

 //...
 uses   ComObj, WIA_TLB,   
 //...
procedure TMainForm.ScanWiaDocument(DocumentRef: String);
const
   wiaFormatJPEG = '{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}';
   wiaFormatPNG  = '{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}';
var
   CommonDlg: ICommonDialog;
   AImage: IImageFile;
   ImagePath: String;
begin
   CommonDlg := CreateOleObject('WIA.CommonDialog') as ICommonDialog;
   //Transfer as JPG
   try try
      AImage := CommonDlg.ShowAcquireImage(ScannerDeviceType,
                ColorIntent,    //or UnspecifiedIntent, GrayscaleIntent, TextIntent
                MinimizeSize,   //or MaximizeQuality
                wiaFormatJPEG,  //image format  **<----Only saves in BMP format!**!
                False,          //AlwaysSelectDevice
                False,          //UseCommonUI
                True);          //CancelError
      //Save the image
      ImagePath := 'C:\temp\scanimage\'+DocumentRef+'.'+ AImage.FileExtension;
      AImage.SaveFile(ImagePath);
   except
       on E:Exception do LogException(E, 'ScanWiaDocument', True);
   end;
   finally  //release interface
      CommonDlg := nil;
      AImage    := nil;
   end;
end;

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:28:48+00:00Added an answer on May 25, 2026 at 9:28 pm

    You are asking ShowAcquireImage() to capture in JPG if possible, but it does not have to honor that. When ShowAcquireImage() exits, the returned ImageFile object has a FormatID property that specifies the format that was actually used, for instance if the scanner does not support JPG. If the file is not already in JPG, you will have to convert it afterwards, such as by using the Wia.ImageProcess object. MSDN shows an example of doing that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using C# (VS2008) and WIA - scanning to TIFF format; When I use the
Using Delphi 2010. I am looking for (possibly) a function or procedure which can
I have a C# (WinForm) program that supports scanning using WIA. I am trying
I want to display live image from the usb PC webcam using C# windows
I'm using WIA for scanning images and noticed, that images aren't stored efficiently as
I wrote a simple scanning code using WIA. I don't have a scanner device
Using Browserlab, it appears that the background image is not centred in Firefox7 for
Using delphi 2010, i am wondering if there someway to escape the following string
I'm using WIA 2.0 to scan images from a HP scanner. The problem is
I'm using WIA to acquire images from a scanner with C#. I can scan

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

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.