学习时间不长,个人理解,参考。
这种东西用c#winform的PictureBox图像组件做肯定没法看。
winform的话,怎么得有个class吧,比如
public class DraggableObject
{
public string Id { get; set; }
public int prim_X { get; set; }
public int prim_Y { get; set; }
public Rectangle Region { get; set; }
public Bitmap Setimage { get; set; }
public void OnPaint(PaintEventArgs e)
{
e.Graphics.DrawImage(SetImage, Region);
}
}
public List<DraggableObject> DesignObjects = new List<DraggableObject>();
记录一些位置啊参数什么的,增加图像List.add,删除图像List.remove,
更新、删除、增加图相或位置变动了,刷新一下容器。
private void xx_Paint(object sender, PaintEventArgs e)
{
foreach (DraggableObject item in DesignObjects)
{
item.OnPaint(e);
}
}
不过,这种东西一定c#搞,还是wpf吧。或unity3D试试