设为首页
加入收藏
站内地图
旧版入口
当前位置:首页 > 站长学院 > 网络编程 > C#

在 C# 中使用画笔

作者:佚名 出处:网络转载 时间:07-31 点击:

内容载入中...
public class Rectangle : Shape
{
protected Point m_Start;
protected Point m_End;
public Rectangle(Point start, Point end, Color fgColor)
{
m_Start = start;
m_End = end;
m_Color = fgColor;
}
public override void Draw(Form canvas)
{
if (canvas == null)
{
return;
}
InitializeGraphics(canvas);
Point startPoint = canvas.PointToScreen(m_Start);
Point endPoint = canvas.PointToScreen(m_End);
MainForm mainForm = (MainForm)canvas;
Color bgColor = GetBackgroundColor(m_Color);
Size rectSize = new Size(m_End.X - m_Start.X, m_End.Y - m_Start.Y);
System.Drawing.Rectangle rectToDraw = new System.Drawing.Rectangle(startPoint, rectSize);
ControlPaint.DrawReversibleFrame(rectToDraw, bgColor, FrameStyle.Thick);
}
}

收藏本文:
】【打印页面】【推荐给朋友】【关闭窗口

站长学院

推荐信息