Page 1 of 1

add page from scanner

Posted: Sun Feb 28, 2010 7:24 am
by kiakia
hi alex
in "VintaSoft Multipage TIFF Demo example" we can add an image from file to imageviewer
how to add a page or multipage from scanner to it possible.if yes please help me with sample code.
thanks in advance

Re: add page from scanner

Posted: Tue Mar 02, 2010 12:24 pm
by Alex

VSTwain class has the GetImage method which returns Bitmap object, you can add Bitmap object to the ImageCollection and work with it.

Best regards, Alexander

Re: add page from scanner

Posted: Tue Mar 02, 2010 2:59 pm
by kiakia
thanks Alex
i tesed it and it worked very nice
Excuse me ,other question:
I want to store acquired images as a multipage tiff in database . Can I do this?
i see , it possible with pdf
i write this code like your example:
MemoryStream mem = VSTwain1.GetImageAsStream(0, ImageFileFormat.TIFF);
for (int i=0;i<=VSTwain1.NumImages - 1;i++)
VSTwain1.SaveImageToStream(0, mem, ImageFileFormat.TIFF);
myCommand.Parameters.Add("@Image", mem.GetBuffer());
but it isnt work
Error is:error at saving the image
thanks thanks