D
Dominik Klein
Hi,
I'm trying to draw on a picturebox, kinda like a very simple paint program.
I tried something like this:
Created a picturebox called pbDrawArea and added the derived event
handler for the paint event:
this.pbDrawArea.Paint += new
System.Windows.Forms.PaintEventHandler(this.pbDrawArea_Paint);
and then implement it and do my stuff:
private void pbDrawArea_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
foreach (Line line in this.lines)
{
g.DrawLine(new Pen(Color.Black), line.start.X,
line.start.Y, line.end.X, line.end.Y);
}
}
When compiling for PocketPC I get an "This method is not supported on
this platform".
However
http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.paint.aspx
does something quite similar and the page clearly states the Paint event
for a picturebox object is supported under "Windows Mobile for Pocket PC"
Any mistakes in my code?
If the OnPaint event is not supported, what other way is there to
implement this?
Thanks,
Dominik
I'm trying to draw on a picturebox, kinda like a very simple paint program.
I tried something like this:
Created a picturebox called pbDrawArea and added the derived event
handler for the paint event:
this.pbDrawArea.Paint += new
System.Windows.Forms.PaintEventHandler(this.pbDrawArea_Paint);
and then implement it and do my stuff:
private void pbDrawArea_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
foreach (Line line in this.lines)
{
g.DrawLine(new Pen(Color.Black), line.start.X,
line.start.Y, line.end.X, line.end.Y);
}
}
When compiling for PocketPC I get an "This method is not supported on
this platform".
However
http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.paint.aspx
does something quite similar and the page clearly states the Paint event
for a picturebox object is supported under "Windows Mobile for Pocket PC"
Any mistakes in my code?
If the OnPaint event is not supported, what other way is there to
implement this?
Thanks,
Dominik