I’m having trouble using DrawImage with the canvas.
After drawing lines and points, I’d like to add a transparent PNG image.
If you see in button2_Click, the first time the canvas is drawn but not the images, the second time the images appear as well. Perhaps a refresh issue?
You need to put your code in the redraw event of the canvas.
When you call the drawing actions on a canvas control they are executed on the browser but not persisted. In Redraw you have to update the control and draw what is persisted.
Your code should look like this:
private void canvas1_Redraw(object sender, EventArgs e)
{
MakeBoard((Canvas)sender);
//insert code here that draws the png images
}
Please login first to submit.