除了在 Visual Studio 中编写 GDI+ 代码,我可以拥有 REPL 吗?

Can I have a REPL but for writing GDI+ code in Visual Studio?

有什么技巧可以在不编译的情况下以图形方式可视化以下 GDI 代码 => 运行 => 停止 => 编辑 => 编译 => 运行?

StringFormat format = new StringFormat();
format.LineAlignment = StringAlignment.Center;    
g.DrawImage(Logo, x, y, _commonProfile.WidthImm, _commonProfile.HeightIntes);
font = new Font("Arial", _commonProfile.FontSizeIntes, FontStyle.Bold);
format.Alignment = StringAlignment.Far;
g.DrawString(Settings.testo_D_sup, font, brush, new RectangleF(x, y, _commonProfile.WidthIntes, _commonProfile.HeightIntes), format);
format.Alignment = StringAlignment.Center;

下面的方法是利用VS中的WF项目设计时支持结合项目级自定义控件。使用 "Add-> New Item->Windows Forms->Custom Control" 命令创建一个新的项目级自定义控件。编译项目,控件将出现在工具箱中。在设计器中打开一个新窗体并将控件放在那里。现在您可以将绘图代码放在控件的 OnPaint 方法中并使用它。唯一的要求是在更改绘图代码后编译项目,表单设计器会立即反映出来。

请记住,此方法不支持调试绘图代码 - 您可以放置​​断点,但它们永远不会被命中。