111,126
社区成员
发帖
与我相关
我的任务
分享
Bitmap smallimage;
Bitmap bigimage;
//read small image
Graphics g = Graphics.FromImage(smallimage);
//draw rectangle(use transparent color)in "遮罩" region
//assume Region is rectangle, otherwise you can use FillEllipse() etc.
g.FillRectangel(new SolidBrush(Color.Transparent), new Rectangle(sizeof遮罩));
//read big image
g = Graphics.FromImage(bigimage);
//draw small image in big image
g.DrawImage(smallimage, 2, 2);
//show the result
Graphics dc = control.CreateGraphics();
dc.DrawImage(bigimage, 0, 0);
//read big image
Graphics gBuffer = Graphics.FromImage(bigimage);
//draw small image in big image
gBuffer.DrawImage(smallimage, 2, 2);
//draw rectangle(use transparent color)in "遮罩" region
//assume Region is rectangle, otherwise you can use FillEllipse etc.
gBuffer.FillRectangel(new SolidBrush(Color.Transparent), new Rectangle(sizeof遮罩));
//show the result
Graphics dc = control.CreateGraphics();
dc.DrawImage(image, 0, 0);
//read
Graphics dc = Graphics.FromImage(yourimage);
dc.“画遮照”!
//show
dc.DrawImage(image, 0, 0);