// Get panel coordinates from relative coordinates (transform) public Point RelativeToPanel(RelativePoint p) { var x = p.X * img.Width * ImageScale * 0.5 + Size.Width / 2.0; var y = p.Y * img.Height * ImageScale * 0.5 + Size.Height / 2.0; return(new Point(ImageClipper.dtoi(x), ImageClipper.dtoi(y))); }
// Get image corrdinates from panel coordinates (transform) public Point PanelToImage(Point p) { var x = (p.X - Size.Width / 2.0) / ImageScale + img.Size.Width / 2.0; var y = (p.Y - Size.Height / 2.0) / ImageScale + img.Size.Height / 2.0; return(new Point(ImageClipper.dtoi(x), ImageClipper.dtoi(y))); }
// Get panel coordinates from image coordinates (transform) public Point ImageToPanel(Point p) { var x = (p.X - img.Size.Width / 2.0) * ImageScale + Size.Width / 2.0; var y = (p.Y - img.Size.Height / 2.0) * ImageScale + Size.Height / 2.0; return(new Point(ImageClipper.dtoi(x), ImageClipper.dtoi(y))); }