3
I’m trying to make a Image Viewer
for multi page Tiffs.
I’m wearing a PictureBox
and two buttons - one to move down and to the next page, and one to move up and to the previous page.
My code goes through the array in question but when I press the button down, it goes through the array and goes to the last page of the TIFF instead of going through one page at a time.
This is the code of my down button - downbut
:
int tamanho;
int idx1 = 1;
public string[] filestiff;
private void downbut_Click(object sender, EventArgs e)
{
tamanho = filestiff.Length;
do {
foreach (string file in filestiff) //para cada ficheiro no array
{
picturetiff.InitialImage = null;
Image a = Image.FromFile(file);
picturetiff.Image = a;
idx1++;
}
} while (idx1 < tamanho);
if (idx1 == tamanho) //quando chegar ao fim do array
{
idx1 = 1;
downbut.Enabled = false;
upbut.Enabled = true;
}
}
What I have to change in my code so that, at each click on the button, walk only one page instead of all at once?
Thanks to those who help!
That’s exactly what it was! Thank you so much!
– Sofia Rodrigues
you can mark as reply @Sofiarodrigues, for nothing =]
– Rovann Linhalis