/// <summary> /// 绘制Item的事件 /// </summary> /// <param name="ACanvas"></param> /// <param name="aDrawRect">当前DrawItem的区域</param> /// <param name="ADataDrawBottom">Item所在的Data本次绘制底部位置</param> /// <param name="ADataScreenTop"></param> /// <param name="ADataScreenBottom"></param> public void PaintTo(HCStyle aStyle, RECT aDrawRect, int APageDataDrawTop, int APageDataDrawBottom, int APageDataScreenTop, int APageDataScreenBottom, HCCanvas ACanvas, PaintInfo APaintInfo) // 不可继承 { int vDCState = ACanvas.Save(); try { DoPaint(aStyle, aDrawRect, APageDataDrawTop, APageDataDrawBottom, APageDataScreenTop, APageDataScreenBottom, ACanvas, APaintInfo); } finally { ACanvas.Restore(vDCState); ACanvas.Refresh(); // 处理下一个使用Pen时修改Pen的属性值和当前属性值一样时,不会触发Canvas重新SelectPen导致Pen的绘制失效的问题 } }