public static int RoundRect(Graphics e, 数据挖掘研究院 Pen pen, SolidBrush brush, int X1, int Y1, int X2, 数据挖掘研究院 int Y2, int X3, int Y3)
{
IntPtr hpen,old_pen;
IntPtr hbrush, old_brush; if(pen!=null)
{
hpen = CreatePen((DashStyle.Solid == pen.DashStyle) ? 0 : 1,
(int)pen.Width, SetRGB(pen.Color.R, pen.Color.G, pen.Color.B)); 数据挖掘研究院 //创建GDI画笔
}
else
{
hpen = GetStockObject(8); //空画笔
} 数据挖掘研究院 if (brush!= null)
{
hbrush = CreateSolidBrush(SetRGB(brush.Color.R, 数据挖掘研究院 brush.Color.G, brush.Color.B)); //brush.Color.ToArgb());
}
else
{
hbrush = GetStockObject(5);
} 数据挖掘研究院 //pen.Dispose();
//brush.Dispose(); 数据挖掘实验室 IntPtr hdc = e.GetHdc();
//---------------------
old_brush=SelectObject(hdc, hbrush);
old_pen=SelectObject(hdc, hpen);
int intRet=RoundRect(hdc, X1, Y1, X2,Y2, X3, Y3); 数据挖掘研究院 SelectObject(hdc, old_brush);
SelectObject(hdc, old_pen);
DeleteObject(hbrush);
DeleteObject(hpen);
//---------------------
e.ReleaseHdc(hdc);
return intRet;
} 数据挖掘研究院
|