VintaSoft Imaging .NET SDK and Plug-ins Discussions
Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.
Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions
_tiff = new TiffFile(openFileDialog1.FileName);
outputFileName = sourceDirectory + splitFolder + "\\" + firstIndex.ToString()+ ".tif";
EncoderBase encoder = AvailableEncoders.FindEncoder(outputFileName);
VintasoftImage image1 = new VintasoftImage();
((TiffEncoder)encoder).CreateNewFile = true;
((TiffEncoder)encoder).Compression = TiffCompression.JPEG;
ImageCollection images = new ImageCollection();
images.ImageSaving += new ImageSavingEventHandler(images_ImageSaving);
images.ImageSaved += new ImageSavedEventHandler(images_ImageSaved);
for (int i = firstIndex; i <= lastIndex; i++)
{
images.Add(_tiff.Pages[i].GetImage());
}
images.Save(outputFileName, (TiffEncoder)encoder);
// MessageBox.Show("ok");
this.label1.Text = barcodeValue + ".tif saved Successfully";
// System.Threading.Thread.SpinWait(5000);
//System.Threading.Thread test = System.Threading.Thread.CurrentThread;
images.Dispose();
images = null;
Please help.TiffFile source = new TiffFile(openFileDialog1.FileName);
int pagesPerFile = 10, currentPagesPerFile = 0;
TiffFile dest = new TiffFile(sourceDirectory + splitFolder + @"\0.tif");
dest.Compression = TiffCompression.JPEG;
int fileIndex = 1;
for (int i = 0; i < source.Pages.Count; i++)
{
dest.Pages.Add(source.Pages[i].GetImage());
if (currentPagesPerFile == (pagesPerFile - 1))
{
dest.Dispose();
dest = new TiffFile(sourceDirectory + splitFolder + "\\" + fileIndex + ".tif");
dest.Compression = TiffCompression.JPEG;
fileIndex++;
currentPagesPerFile = 0;
}
else
{
currentPagesPerFile++;
}
}
dest.Dispose();
source.Dispose();
Best regards, Alexander