I'm trying to use Bar Code Recognition software and need to iterate over all the frames in a tiff file. I am confused on several points: 1) What is a frame, why does it have a guid and why do I need to iterate over frames? I can't seem to find a lot of documentation.
2) The code throws an invalid parameter exception after one iteration. I'm not sure why; logically, i cannot exceed the frame count, so not sure how it could be an invalid parameter, assuming that is the problem.
System.Drawing.Image img = System.Drawing.Image.FromStream(mems);
Guid guid = img.FrameDimensionsList[0];
FrameDimension dimension = new FrameDimension(guid);
int totalFrame = img.GetFrameCount(dimension);
foreach(int i =0; i < totalFrame; i++)
{
img.SelectActiveFrame(dimension, i);
}