cuihongyu3503319

 

 

                #region 给透明的png图片加入白色底色
                Image Image = Image.FromFile("路径");
                Bitmap pbitmap = new Bitmap(Image);
                Graphics g2 = Graphics.FromImage(Image);
                GraphicsPath gp = new GraphicsPath(); //新建图像路径来存储透明的点

                for (int x = 0; x < 60; x++)
                {
                    for (int y = 0; y < 60; y++)
                    {

                        Color c = pbitmap.GetPixel(x, y);

                        if (c.A == 0)
                        {
                            gp.AddRectangle(new Rectangle(x, y, 1, 1));//添加点到路径
                            g2.DrawPath(Pens.White, gp);
                        }
                        else
                        {

                        }
                    }
                }
                #endregion

 

分类:

技术点:

相关文章:

  • 2021-12-13
  • 2021-12-13
  • 2021-12-26
  • 2022-01-20
  • 2021-12-13
  • 2021-10-28
  • 2021-10-08
  • 2022-02-08
猜你喜欢
  • 2021-07-27
  • 2022-12-23
  • 2022-01-08
  • 2021-11-28
  • 2022-12-23
  • 2021-12-04
  • 2022-02-26
相关资源
相似解决方案