Forum Replies Created
- AuthorPosts
- December 5, 2013 at 3:26 am in reply to: Capabilitie Trouble when 16 Bit Grayscale Tiff Scanning #25541
Hi there
I have googled a code for tiff scanning:
RasterEdgeImaging TIFF = new RasterEdgeImaging();
public class AcquisitionClass
{
private bool AcquireCanceled;
private Acquisition Acquisition = new Acquisition(this);
public void Scan()
{
AcquireCanceled = false;
Acquisition.AcquireCanceled += new EventHandler(OnAcquireCanceled);
Acquisition.AcquireFinished += new EventHandler(OnAcquireFinished);
Acquisition.ImageAcquired += new ImageAcquiredEventHandler(OnImageAcquired);
Device activeDevice = Acquisition.ShowSelectSource();
activeDevice.Acquire();
}
private void OnImageAcquired(object sender, AcquireEventArgs e)
{
if (e.Image != null)
{
TiffEncoder enc = new TiffEncoder(TiffCompression.Default, true);
FileStream fs = new FileStream(“1.tif”,FileMode.OpenOrCreate, FileAccess.ReadWrite);
enc.Save(fs, AtalaImage.FromBitmap(e.Image), null);
fs.Close();
}
}
private void OnAcquireCanceled(object sender, EventArgs e)
{
AcquireCanceled = true;
}
private void OnAcquireFinished(object sender, EventArgs e)
{
if (AcquireCanceled)
return;
TiffImageCollection col = new TiffImageCollection();
TiffDecoder dec = new TiffDecoder();
FileStream fs = new FileStream(“1.tif”, FileMode.Open, FileAccess.Read);
int frameCount = dec.GetFrameCount(fs);
fs.Close();
for(int i=0; i< frameCount; i++)
col.Add(new TiffImage(“1.tif”, i, TiffCompressionType.Auto));FileStream outStream = new FileStream(“1.tiff”, FileMode.OpenOrCreate, FileAccess.ReadWrite);
TiffEncoder enc = new TiffEncoder();
enc.Save(outStream, col, null);
}
But it can not word effectively.What’s wrong with my code?
Is there any powerful tiff processing program which supports to do that directly?Thanks a lot.@danny rough wrote:
I use a tiff spliter driver found on the internet . Install it and it becomes a selectable option.Then you can split mutipage tiff into single ones in many formats in any program at all, including Adobe Acrobat . Just open the sdk, select tiff , and choice split, then you can split pdf in c#, vb, asp ,etc ,the task will be finished in several seconds. then you can save images to multi tiff. as for scanner , you can try this tiff scannerwhich can be allpied in vb, c#,etc. besides , it can be freely used for trial for 30 days, just have a check! if you haven´t found a good choice , you can have a try. best wishes
Hi there
Thanks for your sharing.It helps me a lot.BTW.if it is possible to process the tiff files offline?
Thanks for any suggestion. - AuthorPosts