コード例 #1
0
ファイル: ImageForm.cs プロジェクト: jPalazon/AppImagenes
        private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
        {
            if (seleccionar)
            {
                PuntoFin = new Point(e.X, e.Y);
                int anchoRectangulo = PuntoFin.X - PuntoInicio.X;
                int  alturaRectangulo = PuntoFin.Y- PuntoInicio.Y;
                Rectangle RectanguloSeleccion = new Rectangle(PuntoInicio.X, PuntoInicio.Y, anchoRectangulo, alturaRectangulo);
                Graphics objGrafico = this.pictureBox1.CreateGraphics();
                Pen pen = new Pen(Color.Red, 1);
                float[] valoresLineaDiscontinua = { 3, 2, 3, 2 };
                pen.DashPattern = valoresLineaDiscontinua;
                objGrafico.DrawRectangle(pen, RectanguloSeleccion);

                ImageForm smallImage = new ImageForm();
                smallImage.seleccion(this.picture_, PuntoInicio, PuntoFin, RectanguloSeleccion);
                smallImage.MdiParent = this.MdiParent;
                smallImage.Show();
            }
        }