Canvas Drawimage

0
0

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?

 

 

Attachment
  • You must to post comments
0
0

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
}

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.