Hello,
I have to say that the demo I provided yesterday has a minor issue, we corrected it. Now you can download the correct one from previous link. And below are my answers to your questions:
1) You can add a button using below code to cancel previous rectangle, and then re-zone a rectangle.
- Code: Select all
private void RemoveRect_Click(object sender, EventArgs e)
{
if (dicLists.Count ==0)
{
MessageBox.Show("Please paint a rectangle!");
}
else
{
dicLists.Remove(dicLists.Keys.ElementAt(dicLists.Count-1));
this.textBox1.Text = dicLists.Count.ToString();
}
}
2) To remove the red rectangle when going to the next page, you could add below code to draw the rectangle with transparent color when mouse is in the MouseUp status.
- Code: Select all
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
//draw the rectangle
if (mouseStatus)
{
g.DrawRectangle(new Pen(Color.Red, 1), Rect);
}
else
{
g.DrawRectangle(new Pen(Color.Transparent, 1), Rect);
}
}
3) Sorry your requirement can not be achieved in our Spire.PDFViewer. If you have other question, please feel free to write back.
Sincerely,
Lisa
E-iceblue support team