

uj5u.com熱心網友回復:
學習時間不長,個人理解,參考。這種東西用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試試
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/29698.html
標籤:C#
