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;