I've been working on a project for class where I need to display on screen polygons (drawed in a Panel), but I've been reading arround here that I should work with Paint event, tho I can't make it work (started learning C# a little ago).
private void drawView()
{
//"playerView" is the panel I'm working on
Graphics gr = playerView.CreateGraphics();
Pen pen = new Pen(Color.White, 1);
//Left Wall 1
Point lw1a = new Point(18, 7);
Point lw1b = new Point(99, 61);
Point lw1c = new Point(99, 259);
Point lw1d = new Point(18, 313);
Point[] lw1 = { lw1a, lw1b, lw1c, lw1d };
gr.DrawPolygon(pen, lw1);
}
I was doing something like this to draw it on screen, it would be possible to do this with a Paint method? (it is called method, or event? I'm really lost here).
Thanks!