Esempio n. 1
0
        private void formPhotoEdit_Load(object sender, EventArgs e)
        {
            m_canvas            = new DesignerCanvas();
            this.skHost1.Canvas = this.m_canvas;

            magickSettingsNoEnchiper.CompressionMethod = CompressionMethod.JPEG;
            magickSettingsNoEnchiper.Format            = MagickFormat.Jpeg;

            magickSettingsEnchiper.CompressionMethod = CompressionMethod.LosslessJPEG;
            magickSettingsEnchiper.Format            = MagickFormat.Png;

            byte[] imageBytes = File.ReadAllBytes(fileName);

            if (encipherDecipher != "")
            {
                originalBmp = new MagickImage(imageBytes, magickSettingsEnchiper);
                cropBmp     = new MagickImage(imageBytes, magickSettingsEnchiper);

                originalBmp.Decipher(encipherDecipher);
                cropBmp.Decipher(encipherDecipher);
            }
            else
            {
                originalBmp = new MagickImage(imageBytes, magickSettingsNoEnchiper);
                cropBmp     = new MagickImage(imageBytes, magickSettingsNoEnchiper);
            }
            this.m_canvas.Add(new BackgroundImageShape()
            {
                Image = cropBmp.ToBitmap()
            }, "Image");
        }