28.8.11

Simple cross drawing :)

Hey, 

Here is a simple cross drawing
using System.Drawing;
//Create graphics object to handle drawings
Graphics gfx = picBox.CreateGraphics(); 
//Get client retangle from out PictureBox that we want the cross in
Rectangle rc = picBox.ClientRectangle; 
//Create a new pen to draw the cross
Pen RedPen = new Pen(Color.Red);
int Size = 10
//Draw the actual cross 
gfx.DrawLine(RedPen, rc.Width / 2, rc.Height / 2 + Size, rc.Width / 2, rc.Height / 2 - Size);
gfx.DrawLine(RedPen, rc.Width / 2 + Size, rc.Height / 2, rc.Width / 2 - Size, rc.Height / 2);

No comments:

Post a Comment