AnimatGuiCtrls.Controls.KeyFrame.Draw C# (CSharp) Method

Draw() public method

public Draw ( Graphics g, TimeRuler ruler ) : void
g System.Drawing.Graphics
ruler TimeRuler
return void
        public virtual void Draw(Graphics g, TimeRuler ruler)
        {
            if (ruler.Orientation == enumOrientation.orHorizontal)
            {
                int x = ruler.ScaleValueToPixel((double) _StartMillisecond) - 1;
                int y1 = ruler.HeaderOffset, y2 = ruler.Height;
                g.DrawLine(_DrawingPen, x, y1, x, y2);

                y1 = ruler.HeaderOffset/2;
                y2 = ruler.HeaderOffset - y1 - 1;
                x = ruler.ScaleValueToPixel((double) _StartMillisecond) - (y2/2) - 1;
                g.DrawEllipse(new Pen(new SolidBrush(ruler.ForeColor)), x, y1, y2, y2);
                g.FillEllipse(_DrawingBrush, x, y1, y2, y2);
            }
            else
            {
                int y = ruler.ScaleValueToPixel((double) _StartMillisecond) - 1;
                int x1 = ruler.HeaderOffset, x2 = ruler.Height;
                g.DrawLine(_DrawingPen, x1, y, x2, y);

                x1 = ruler.HeaderOffset/2;
                x2 = ruler.HeaderOffset - x1 - 1;
                y = ruler.ScaleValueToPixel((double) _StartMillisecond) - (x2/2) - 1;
                g.DrawEllipse(new Pen(new SolidBrush(ruler.ForeColor)), x1, y, x2, x2);
                g.FillEllipse(_DrawingBrush, x1, y, x2, x2);
            }
        }