我希望在我的图形形状周围创建一个大纲,向我展示我在创建形状的位置,当我放置形状时,轮廓将消失,只留下形状,Here是一个概念gif。
这是代码
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
bitmap bm;
if (currItem == Tool.Square)
{
Graphics g = Graphics.FromImage(bm);
g.DrawRectangle(new Pen(new SolidBrush(panel1.BackColor)), e.X ,e.Y, x - e.X, y - e.Y);
// Canvas is a Picture Box
Canvas.Invalidate();
g.Dispose();
}