示例#1
0
        protected override void DoPaint(HCStyle aStyle, RECT aDrawRect, int aDataDrawTop, int aDataDrawBottom, int aDataScreenTop, int aDataScreenBottom, HCCanvas aCanvas, PaintInfo aPaintInfo)
        {
            aCanvas.Pen.BeginUpdate();
            try
            {
                aCanvas.Pen.Width = FLineHeight;
                aCanvas.Pen.Style = FLineStyle;
                aCanvas.Pen.Color = Color.Black;
            }
            finally
            {
                aCanvas.Pen.EndUpdate();
            }

            if (this.Height > 1)
            {
                IntPtr vExtPen = HC.CreateExtPen(aCanvas.Pen, GDI.PS_ENDCAP_FLAT);
                IntPtr vOldPen = (IntPtr)GDI.SelectObject(aCanvas.Handle, vExtPen);
                try
                {
                    PaintLine(aCanvas, aDrawRect);
                }
                finally
                {
                    GDI.SelectObject(aCanvas.Handle, vOldPen);
                    GDI.DeleteObject(vExtPen);
                }
            }
            else
            {
                PaintLine(aCanvas, aDrawRect);
            }
        }