問題controls.add(pic)
private void blockRoadMouseMove(System.Object sender,
System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
if (Control.ModifierKeys == Keys.Control)
{
int yo = this.Location.Y;
int startx = this.Left;
int cx = startx;
int mo = e.X + this.Left - clickOffsetX;
DrawingControl.SuspendDrawing(mainPic);
mainPic.SuspendLayout();
blockRoad pic = new blockRoad(mainPic);
DrawingControl.SuspendDrawing(pic);
for (int t = cx; t < mo; t += 20)
{
pic.setChar(this.Image, t, yo);
}
mainPic.ResumeLayout();
DrawingControl.ResumeDrawing(mainPic);
}
}
}
私はそれを使用しました
class DrawingControl
{
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, Int32 wMsg, bool wParam, Int32 lParam);
private const int WM_SETREDRAW = 11;
public static void SuspendDrawing(Control parent)
{
SendMessage(parent.Handle, WM_SETREDRAW, false, 0);
}
public static void ResumeDrawing(Control parent)
{
SendMessage(parent.Handle, WM_SETREDRAW, true, 0);
parent.Refresh();
}
}
問題は、1 つの位置に多くの (写真) を追加することです。次の位置に多くの追加..次の追加...
(すべての) 1 つの位置に多くの写真を追加する すべての位置に (1 つの) 写真を追加したい