未完成
PictureBox puser;
private void _loadUser()
{
Tools tl = Tools._getPicture();
Picture pt= tl._getplay();
string picFileName = pt.imgUrl;//图片bai文件du名路路径
puser = new PictureBox();
puser.Name = "player";
puser.Size = new System.Drawing.Size(16, 16);
Point picLocatoin = new Point(pt.pointX, pt.pointY);
puser.Location = picLocatoin;
//加载zhi图片
puser.Image = new Bitmap(picFileName);
//窗体类加子控件添加该picBox控件
panel1.Controls.Add(puser);
}
private void _loadEnemy()
{
Tools tl = Tools._getPicture();
Picture pt = tl._getEnemy();
string picFileName = pt.imgUrl;//图片bai文件du名路路径
PictureBox pic = new PictureBox();
pic.Name = "enemy";
pic.Size = new System.Drawing.Size(16, 16);
Point picLocatoin = new Point(pt.pointX, pt.pointY);
pic.Location = picLocatoin;
//加载zhi图片
pic.Image = new Bitmap(picFileName);
//窗体类加子控件添加该picBox控件
panel1.Controls.Add(pic);
Thread t = new Thread(new ThreadStart(delegate ()
{
while (true)
{
pic.Location = _movePicture(pic.Location);
--_enemy;
Thread.Sleep(200);
}
}));
t.Start();
}
评论