Saving an image as TIFF both direct as via clipboard

Discussions about image processing and document imaging.
Post Reply
eagleman
Posts: 27
Joined: Mon Jan 25, 2010 1:48 pm

Saving an image as TIFF both direct as via clipboard

Post by eagleman » Tue Mar 30, 2010 2:18 pm

I have scanned a document and saving the scanned image as a TIFF file. I also copy the image to the clipboard and creating a new image from the clipboard.
This created image is also saved as TIFF.
Both files hold the same image, but differ in file size (51K vs 915K).

//save scanned image as a TIFF file
oImaging.SaveAsTIFF(imageID, "Test_1_.TIF", TiffCompression.TiffCompressionCCITT4);
//Copy image to clipboard
oImaging.CopyToClipboard(imageID);
//Create image from clipboard data
int tempID = oImaging.CreateGdPictureImageFromClipboard();
//save image as a TIFF file
oImaging.SaveAsTIFF(tempID, "Test_2_.TIF", TiffCompression.TiffCompressionCCITT4);

Test_1_.TIF >>> 51 Kbytes

test_2_.TIF >>> 915 Kbytes

Why is there such a big difference if file size?

eagleman

User avatar
Loïc
Site Admin
Posts: 5592
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Saving an image as TIFF both direct as via clipboard

Post by Loïc » Wed Mar 31, 2010 9:43 am

Hi,

Please replace

Code: Select all

oImaging.CopyToClipboard(imageID);
//Create image from clipboard data
int tempID = oImaging.CreateGdPictureImageFromClipboard();
by

Code: Select all

oImaging.CopyToClipboard(imageID);
//Create image from clipboard data
int tempID = oImaging.CreateGdPictureImageFromClipboard();
oImaging.ConvertTo1BppFast(imageID);
You should get now the same file size :)

Loïc

eagleman
Posts: 27
Joined: Mon Jan 25, 2010 1:48 pm

Re: Saving an image as TIFF both direct as via clipboard

Post by eagleman » Wed Mar 31, 2010 4:18 pm

It works.

Thanks.

eagleman

User avatar
Sephir
Posts: 13
Joined: Wed Sep 17, 2014 5:38 pm
Location: Germany
Contact:

Re: Saving an image as TIFF both direct as via clipboard

Post by Sephir » Tue Oct 10, 2017 3:50 pm

Hi there,

I know its a pretty old Thread, but I still dont get it. Im using GDPicture14 right now, and if I use

oImaging.CopyToClipboard(imageID);

and later

int tempID = oImaging.CreateGdPictureImageFromClipboard();

I get totally different results ( different Resolution (from 300 to 120)). When I copy an ImageID with 300 DPI and BW , I expect after a CreateGdPictureImageFromClipboard() an identical copy from the Clipboard (Same Filesize, same attributes). Why do I need to convert it again ?

Especially, if i give a 300DPI Resolution(x/y)GDPicture Image into the Clipboard, how I am supposed to "convert" it back to 300 DPI ? (the CreateGDPictureImageFromClipboard always returns 120 px X/Y Resolution).


Kind regards

Matt

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests