In Windows form, I am trying to render the Line by setting style as DashStyle.Dot by using Graphics and Graphics page scale as 0.50. But the line does not rendered in form. Please anyone suggest me on this....
refer to the below code snippet:
protected override void OnPaint(PaintEventArgs e)
{
gp = e.Graphics;
gp.PageScale = 0.50f;
using (System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.White))
{
gp.FillRectangle(myBrush, new RectangleF(30, 100, 400, 600));
}
// Create pen.
using (Pen blackPen = new Pen(Color.Black, 0))
{
blackPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;
gp.DrawLine(blackPen, 30, 200, 430, 200);
}
}