Page 1 of 1

Saving an image as TIFF both direct as via clipboard

Posted: Tue Mar 30, 2010 2:18 pm
by eagleman
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

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

Posted: Wed Mar 31, 2010 9:43 am
by Loïc
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

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

Posted: Wed Mar 31, 2010 4:18 pm
by eagleman
It works.

Thanks.

eagleman

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

Posted: Tue Oct 10, 2017 3:50 pm
by Sephir
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