wansch
12/22/2004 2:59:00 PM
Hello all,
I'm a newbie to programming and my question is:
For what is it good to draw with float values in graphic routines since
pixels are always integer.
Also I have tried the following code and ask myself if this is correct:
class F1 : Form
{
protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen p1 = new Pen(Color.Red);
//Line 1: 11 pixel long
PointF ptf1 = new PointF(25.5f, 45.4f);
PointF ptf2 = new PointF(36.3f, 45.4f);
g.DrawLine(p1, ptf1, ptf2);
//Line 2: 12 pixel long
PointF ptf3 = new PointF(25.5f, 55f);
PointF ptf4 = new PointF(36.3f, 55f);
g.DrawLine(p1, ptf3, ptf4);
p1.Dispose();
}
}