Properties such as the color and width may similarly be changed after a Pen has been created: myPen.DashStyle = .DashDotDot For example, the DashStyle property can be modified to change the style of line (i.e Dash, DashDot, DashDotDot, Dot, Solid or Custom). Once a Pen object has been created other properties may be changed. Where variable_name is the name to be assigned to the Pen object, color is the color of the pen and width is the width of the lines to be drawn by the pen.įor example, we can create red pen that is 5 pixels wide as follows: private void Form1_Paint(object sender, PaintEventArgs e) Pen variable_name = new Pen ( color, width) A Pen object may be quite easily created as follows: A Graphics Object is of little use without a Pen object with which to draw (much as a sheet of paper is no good without a pen or pencil).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |