Hi
I have a problem which i cant seem to solve or font really know where to start im only starting learning c# so dont have a lot of experience.
Basically my problem is that i intend to loop through a directory of .tif images which contain BW and Colour pages, i do a check to identify the colour pages which i use a third party control to help do this, when i find a colour page i want to be able to split this page out to a .jpeg image but dont really know how to do it anyway this is as far as i have got.
// Get list of source files
string inFolder = String.Format("{0}{1}{2}",
sourcePath, Path.DirectorySeparatorChar, document);
foreach (string srcFile in Directory.GetFiles(inFolder, "*.tif"))
{
// Open the source file
ImagistikTK.TK tifImg = new TK();
tifImg.OpenFile.FileName = srcFile;
tifImg.OpenFile.Licensecode = "";
float result = tifImg.OpenFile_Execute();
if (result == 0)
{
// Check are there any color pages?
for(int i = 1; i<= tifImg.Info.Pages; i++)
{
ImagistikTK.TK page = new TK();
page.OpenFile.Licensecode = "";
page.OpenFile.FileName = srcFile;
page.OpenFile.PageNumber = i;
page.OpenFile_Execute();
int pageNum = i;
if(page.BMP_TK.PixelFormat == PixelFormat.Format24bppRgb)
{
string destFile = String.Format("{0:0000000}{1}", destFileNo, ".jpg");
// Yes - split file
FileStream inFile = new FileStream(srcFile, FileMode.Open, FileAccess.Read);
FileStream outFile = new FileStream(i + ".jpeg", FileMode.Create, FileAccess.Write);
Any help appreciated.