private void FormControlePrintScreen_Load(object sender, EventArgs e)
 {
     this.etatModeImage   = modeImage.center;
     this.buttonMode.Text = "Zoomer";
     FormControlePrintScreen.chargerImage(etat.initial, this);
     this.Focus();
 }
Example #2
0
        private void SaveToClipboard()
        {
            //valide si une selection existe
            if (selectLargeur > 0 && selectHauteur > 0)
            {
                Rectangle rect          = new Rectangle(postionX0, positionY0, selectLargeur, selectHauteur);
                Bitmap    OriginalImage = new Bitmap(pictureBox1.Image, pictureBox1.Width, pictureBox1.Height);
                Bitmap    _img          = new Bitmap(selectLargeur, selectHauteur);
                Graphics  g             = Graphics.FromImage(_img);
                g.InterpolationMode  = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
                g.PixelOffsetMode    = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality;
                g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
                g.DrawImage(OriginalImage, 0, 0, rect, GraphicsUnit.Pixel);

                FormControlePrintScreen.imprimeEcran = _img;


                FormControlePrintScreen.chargerImage(FormControlePrintScreen.etat.fonctionnement, FormControlePrintScreen.formMainCapture);
                FormControlePrintScreen.formMainCapture.Show();
                FormControlePrintScreen.formMainCapture.Focus();
                this.Close();
            }
        }