I have a .NET program that has to save an array of am saving an array CWIMAQImage images to disk at high speed (the array will be fed by a cameraLink camera). The images are 1344x1024x16bits large. Even arrays as "small" as 20 images can't be saved continuously - the saving seems to stop every now and then. I can't understand this, as I have a P4 3,2 GHz with 4 GB Ram (XP Pro). This can't be a system cache problem, can it? I've already tried isolating the whole thing (separate hdd, switching off windows indexing service and virus scanner for the disk) - the problem stays.
Here a few snippets of my c#-Code:
object missing = System.Reflection.Missing.Value; // ILDASM tells us, that with VBs optional arguments the CLR creates an object of type System.Reflection.Missing on the stack - C# doesn't have optional arguments...
// load test images from disk into memory
CWIMAQImage[] sourceImages = new CWIMAQImage[filesToConvert.Length];
for (int i = 0; i < filesToConvert.Length; i++)
{
sourceImages[i] = axCWIMAQVision1.CreateCWIMAQImage();
sourceImages[i].Type = CWIMAQImageTypes.cwimaqImageTypeI16;
axCWIMAQVision1.ReadImage(sourceImages[i], filesToConvert[i], missing);
}
// save images to disk
CWIMAQTIFFFileOptions to = axCWIMAQVision1.CreateCWIMAQTIFFFileOptions();
to.CompressionMethod = CWIMAQTIFFCompressionMethods.cwimaqTIFFCompressionNone;
for (int i = 0; i < filesToConvert.Length; i++)
{
targetFileName = Path.GetFileNameWithoutExtension(filesToConvert[i]) + ".tif";
axCWIMAQVision1.WriteTIFFFile(sourceImages[i], targetDirectory + targetFileName, to, missing);
backgroundWorker1.ReportProgress((i + 1) * 100 / filesToConvert.Length);
}
What can I do to solve this? Or is there a way of direct streaming data to the disk?
Thx for your help
Fabian