C#中如何把图片放到picturebox上的指定位置
1个回答
展开全部
构造一个跟picturebox1一样大小的Bitmap,
设置给picturebox1,
然后在上面画图
Bitmap image = new Bitmap(picturebox1.Size.Width, picturebox1.Size.Height);
Graphics device = Graphics.FromImage(image);
//如果picturebox1本身有内容,就先画到image上
device.DrawImage(picturebox2.Image, w, h); //用你想要的位置画picturebox2
picturebox1.Image = image;
设置给picturebox1,
然后在上面画图
Bitmap image = new Bitmap(picturebox1.Size.Width, picturebox1.Size.Height);
Graphics device = Graphics.FromImage(image);
//如果picturebox1本身有内容,就先画到image上
device.DrawImage(picturebox2.Image, w, h); //用你想要的位置画picturebox2
picturebox1.Image = image;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询