在图片上画直线比画框更简单。线形的控制还是通过对Pen的设置来实现的。

        {
            if (bmp == nullreturn null;

            if (p0.X == p1.X || p0.Y == p1.Y) return bmp;

            Graphics g = Graphics.FromImage(bmp);

            Brush brush = new SolidBrush(LineColor);

            Pen pen = new Pen(brush, LineWidth);
            //pen.Alignment = PenAlignment.Inset;

            pen.DashStyle = ds;

            g.DrawLine(pen,p0,p1);

            g.Dispose();

            return bmp;
        }

相关文章:

  • 2021-04-18
  • 2021-12-15
  • 2021-07-16
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2021-12-30
猜你喜欢
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2021-11-22
  • 2022-01-01
相关资源
相似解决方案