| C1.C1Flash.2 Assembly > C1.C1Flash Namespace > FPage Class > DrawLine Method : DrawLine(Pen,Point,Point) Method |
The pen parameter is a regular System.Drawing.Pen object, which defines the width, color, and style of the line. The system pens (e.g. Pens.Black, Pens.Red, etc) have a width of one point. If you want to draw thinner or thicker lines, you have to create new System.Drawing.Pen objects.
SWF file format has no native support for dashed or dotted line styles. A dashed line can be simulated by breaking up the path into a series of short lines. All lines in SWF file format have rounded joins and end-caps.
C1FlashCanvas canvas = new C1FlashCanvas(); // draw a line with system pen canvas.DrawLine(Pens.Green, 100, 100, 300, 100); // create a thick blue pen Pen thickPen = new Pen(Color.Blue, 3); canvas.DrawLine(thickPen, 100, 120, 300, 120); // change the color and width thickPen.Color = Color.Red; thickPen.Width = 6; canvas.DrawLine(thickPen, 100, 140, 300, 140); canvas.RenderToFile(@"c:\temp\line.swf");