欢迎加我的QQ群:193522571,一起来讨论、交流!

AutoCAD.Net/C#.Net QQ群:193522571 C# Winform利用bitmap生成透明背景的图片

 

pbPartition.BackColor = Color.Transparent;

PointF p1 = new PointF(0, 0);
PointF p2 = new PointF(20, 20);
PointF[] points = { p1, p2 };
CutBmp = (Bitmap)MyResource.ResourceManager.GetObject("TubeLayout_1_1");
gCut = Graphics.FromImage(CutBmp);

gCut.Clear(Color.Transparent);

gCut.TranslateTransform(pbPartition.Width / 2, pbPartition.Height / 2);
gCut.ScaleTransform(1f, -1f);
gCut.TransformPoints(CoordinateSpace.Page, CoordinateSpace.World, points);

pbPartition.Image = CutBmp;

 

posted @ 2021-04-12 14:40  swtool  阅读(514)  评论(0编辑  收藏  举报
欢迎加我的QQ群:193522571,一起来讨论、交流!