C#中PictureBox如何获取中间垂直部分的最高点
1个回答
展开全部
Point topCenterPoint = new Point(this.pictureBox1.Width / 2, 0);
//测试代码
Graphics g = pictureBox1.CreateGraphics();
g.Clear(Color.White);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.CompositingQuality = CompositingQuality.HighQuality;
Point bottomCenterPoint = new Point(this.pictureBox1.Width / 2, this.pictureBox1.Height);
g.DrawLine(Pens.Red, topCenterPoint, bottomCenterPoint);
//测试代码
Graphics g = pictureBox1.CreateGraphics();
g.Clear(Color.White);
g.SmoothingMode = SmoothingMode.AntiAlias;
g.CompositingQuality = CompositingQuality.HighQuality;
Point bottomCenterPoint = new Point(this.pictureBox1.Width / 2, this.pictureBox1.Height);
g.DrawLine(Pens.Red, topCenterPoint, bottomCenterPoint);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询