小编Xar*_*ris的帖子

刷新表单后如何保持绘制的形状?

我试图在Visual Studio 2015中创建一个小的绘图应用程序.我的项目属于Windows窗体应用程序的类别.我有以下问题:

 private void Form1_MouseMove(object sender, MouseEventArgs e)
    {
        if (a == 1)
        {
            if (r == 1 || el == 1)
            {
                int x = Math.Min(inX, e.X);
                int y = Math.Min(inY, e.Y);
                int width = Math.Max(inX, e.X) - Math.Min(inX, e.X);
                int height = Math.Max(inY, e.Y) - Math.Min(inY, e.Y);
                rect = new Rectangle(x, y, width, height);
                Refresh();
            }
            else if (l == 1)
            {
                ep = e.Location;
                Refresh();
            }
            else
            {
                ep = e.Location;
                g = this.CreateGraphics();
                g.DrawLine(p, sp, …
Run Code Online (Sandbox Code Playgroud)

c# gdi+ winforms

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

标签 统计

c# ×1

gdi+ ×1

winforms ×1