Esempio n. 1
0
        // 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)));
        }
Esempio n. 2
0
        // 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)));
        }
Esempio n. 3
0
        // 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)));
        }
Esempio n. 4
0
 private void ImageClipButton_Click(object sender, EventArgs e)
 {
     if (ClipPoints.Count == 4)
     {
         ImagePanel.img = ImageClipper.ClipImage(ImagePanel.img, ClipPoints);
         ImageResetButton_Click(sender, e);
     }
 }
Esempio n. 5
0
 private void ImageScaleButton_Click(object sender, EventArgs e)
 {
     ImagePanel.img = ImageClipper.ScaleImage(ImagePanel.img, (float)ImageScaleInput.Value);
     ImageResetButton_Click(sender, e);
     MessageBox.Show("Image scale set", "Done");
 }