| | |
| | | #endregion |
| | | |
| | | #region ElementBase |
| | | //private void CenterPoint_PropertyChanged(object sender, PropertyChangedEventArgs e) |
| | | //{ |
| | | // SetNormalPen(); |
| | | //} |
| | | |
| | | //protected override void SetNormalPen() |
| | | //{ |
| | | // if (CenterPoint.IsBasePoint) |
| | | // { |
| | | // HalfRectangleSize = 20; |
| | | // HalfLength = 80; |
| | | |
| | | // Pen = new Pen(Color.DarkGreen, 1); |
| | | // } |
| | | // else |
| | | // { |
| | | // HalfRectangleSize = 10; |
| | | // HalfLength = 30; |
| | | |
| | | // base.SetNormalPen(); |
| | | // } |
| | | //} |
| | | |
| | | public override void Calculate(string imagePath) |
| | | { |
| | | //throw new NotImplementedException(); |
| | | } |
| | | |
| | | public override void Calculate(Bitmap image) |
| | | { |
| | | //throw new NotImplementedException(); |
| | | } |
| | | |
| | | public override void Calculate(IntPtr imagePtr, int ptrSize, int imageWidth, int imageHeight) |
| | | { |
| | | //throw new NotImplementedException(); |
| | | } |
| | | |
| | | public override object Clone() |
| | | { |
| | | //throw new NotImplementedException(); |
| | |
| | | g.DrawLine(arrowPen, (float)ImagePoint.X, (float)ImagePoint.Y, (float)ImagePoint.X + (float)(HalfLength * Math.Cos(Angle * Math.PI / 180.0)), (float)ImagePoint.Y - (float)(HalfLength * Math.Sin(Angle * Math.PI / 180.0))); |
| | | |
| | | string info = $"{Index} 图像坐标:{ImagePoint.X},{ImagePoint.Y}\r\n机台坐标:{PlatPoint.X},{PlatPoint.Y}\r\n角度:{Angle}"; |
| | | g.DrawString(info, new Font("NewRoman", FontSize), new SolidBrush(Pen.Color), new PointF((float)ImagePoint.X + FontDistance, (float)ImagePoint.Y + FontDistance)); |
| | | g.DrawString(info, Font, new SolidBrush(Pen.Color), new PointF((float)ImagePoint.X + FontDistance, (float)ImagePoint.Y + FontDistance)); |
| | | } |
| | | |
| | | public override bool IsMouseHover(Point p) |
| | |
| | | return rect.IntersectsWith(BaseRectangle); |
| | | } |
| | | |
| | | public override void CalculateBaseRectangle() |
| | | public void CalculateBaseRectangle() |
| | | { |
| | | BaseRectangle = new Rectangle(new Point((int)ImagePoint.X - HalfRectangleSize, (int)ImagePoint.Y - HalfRectangleSize), new Size(HalfRectangleSize * 2, HalfRectangleSize * 2)); |
| | | } |