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

scan in .jpg

Forums › TWAIN Classic › scan in .jpg

  • This topic has 7 replies, 2 voices, and was last updated 13 years, 8 months ago by gabe.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • May 30, 2007 at 8:56 am #22150 Reply
    sylvain
    Participant
    • Topics - 1
    • Replies - 3
    • Total Posts - 4

    Hi,

    I have already create a program which scan a document and save it into a .bmp file. Now, I would like to save this file into a .jpg file. To do it I tryed to replace the DAT_IMAGENATIVEXFER by DAT_JPEGCOMPRESSION in the aquisition command. But it doesn’t work? here is the parameters used : DG_IMAGE,DAT_JPEGCOMPRESSION,MSG_GET; Anybody can help me ??

    May 30, 2007 at 11:56 am #23822 Reply
    gabe
    Participant
    • Topics - 9
    • Replies - 583
    • Total Posts - 592

    You’re looking for icap_imagefileformat.

    I typically handle this in 2 steps. I’ll first check if the device in question seems to support the output format that I’m looking for using icap_imagefileformat/get. If the format that I want the output in is supported by the device, I get set it with icap_ImageFileFormat/Set. If the format that I’m looking for isn’t supported by the device (it happens), then I play outside of twain spec with the installed encoders on the machine and convert the image by hand – ref msdn.

    May 31, 2007 at 3:08 pm #23823 Reply
    sylvain
    Participant
    • Topics - 1
    • Replies - 3
    • Total Posts - 4

    I use icap_ImageFileFormat in my program but how could I verify that the parameter had been corrctly inserted?

    Is there other operation that i could do to obtain a .jpg file??

    June 1, 2007 at 7:14 am #23824 Reply
    gabe
    Participant
    • Topics - 9
    • Replies - 583
    • Total Posts - 592

    1) Check that source supports jpg with ImageFileFormat.Get.
    2) Set to jpg is it isn’t already set with ImageFileFormat.Set.
    3) Double check that #2 is right with ImageFileFormat.Get.
    4) Execute Control.SetupFileXfer.Set and pass in a twSetupFileXfer structure making sure you set the .Format and .Filename fields appropriately.

    It shouldn’t be much trickier than this. If you read .net code look at the method TransferPicturesAsFile in the ctwain.vb file in my source over at codeplex/openTwain.

    If you have more questions, just ask.

    .

    June 4, 2007 at 11:54 am #23825 Reply
    sylvain
    Participant
    • Topics - 1
    • Replies - 3
    • Total Posts - 4

    thanks for your help Gabe! I have another question. I have hide the user interface and i would like to set the scan resolution to 300 dpi. I have to use ICAP_XRESOLUTION and ICAP_YRESOLUTION but it doesn’t work and I don’t understand why. Somebody has an idea? a piece of source code in C/C++??

    June 5, 2007 at 9:27 am #23826 Reply
    gabe
    Participant
    • Topics - 9
    • Replies - 583
    • Total Posts - 592

    the toolkit has an aweful lot of c++ code in it if you havent been thru it already:
    https://www.twain.org/devfiles/twainkit.exe

    the problems I’d seen/had with setting resolution in the past we mostly due to the fix32 structure that you use. Take a look thru how it is accomplished in the toolkit and if you’re still having trouble open a new thread with the issue.

    cheers.

    June 25, 2007 at 3:40 pm #23827 Reply
    sylvain
    Participant
    • Topics - 1
    • Replies - 3
    • Total Posts - 4

    it works now! thanks a lot !!! 😉

    June 25, 2007 at 7:33 pm #23828 Reply
    gabe
    Participant
    • Topics - 9
    • Replies - 583
    • Total Posts - 592

    what was the issue (just curious)

    .

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Reply #23828 in scan in .jpg
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

  • Scanner starts transfer when console gets closed (CITRIX)
  • Kodak RFS 3600
  • Didn’t save enough file scan
  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • 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.