//要截图的图片
Image img = Image.FromFile("D:\\soure.jpg");

//截图画板
Bitmap bm = new Bitmap(200, 200);
Graphics g = Graphics.FromImage(bm);
 
//创建截图路径(类似Ps里的路径)
GraphicsPath gpath = new GraphicsPath();
gpath.AddEllipse(0, 0, 200, 200);//圆形

//设置画板的截图路径
g.SetClip(gpath); 

//对图片进行截图
g.DrawImage(img, 0, 0); 

//保存截好的图
bm.Save("D:\\new.png", ImageFormat.Png);

 

相关文章:

  • 2022-12-23
  • 2021-11-17
  • 2021-12-29
  • 2022-12-23
  • 2021-12-19
  • 2021-12-19
  • 2022-12-23
  • 2021-07-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2021-12-19
  • 2021-06-18
  • 2022-12-23
相关资源
相似解决方案