小编vor*_*tex的帖子

旋转形状时,它与旋转的形状保持在一起

我是学生,我在这里很新.我有一个课程项目来制作类似Paint的程序.我有一个基类Shape与DrawSelf,包含等.现在,Rectangle,Ellipse和Triangle的方法和类.此外,我有两个其他类的DisplayProccesor,它是绘图类,DialogProcessor,它控制与用户的对话.Theese是该项目的要求.

public class DisplayProcessor
{

    public DisplayProcessor()
    {
    }

    /// <summary>
    /// List of shapes
    /// </summary>
    private List<Shape> shapeList = new List<Shape>();
    public List<Shape> ShapeList
    {
        get { return shapeList; }
        set { shapeList = value; }
    }

    /// <summary>
    /// Redraws all shapes in shapeList
    /// </summary>
    public void ReDraw(object sender, PaintEventArgs e)
    {
        e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
        Draw(e.Graphics);
    }

    public virtual void Draw(Graphics grfx)
    {
        int n = shapeList.Count;
        Shape shape;

        for …
Run Code Online (Sandbox Code Playgroud)

c# drawing winforms

6
推荐指数
1
解决办法
346
查看次数

标签 统计

c# ×1

drawing ×1

winforms ×1