protected void popupPictureTrimmer1_PopupClose(object sender, PictureTrimmerPopupCloseEventArgs e)
    {
        if (e.SaveChanges)
        {
            // User clicked the "Ok" button

            // Save the PictureTrimmer value and the output image in the DB
            using (SqlConnection connection = ExamplesHelper.GetNewOpenDbConnection_SqlServer())
            {
                using (SqlCommand command = connection.CreateCommand())
                {
                    command.CommandText = "UPDATE [Ex_A_306] SET [PictureTrimmerValue]=@PictureTrimmerValue, [OutputImage]=@OutputImage  WHERE [Id]=@Id";
                    command.Parameters.AddWithValue("@PictureTrimmerValue", CodeCarvings.Piczard.Serialization.JSONSerializer.SerializeToString(this.popupPictureTrimmer1.Value));
                    command.Parameters.AddWithValue("@OutputImage", this.popupPictureTrimmer1.SaveProcessedImageToByteArray(new JpegFormatEncoderParams()));
                    command.Parameters.AddWithValue("@Id", RecordID1);
                    command.ExecuteNonQuery();
                }
            }

            // Display the new image
            this.displayImage1();
        }

        // Unload the image from the control
        this.popupPictureTrimmer1.UnloadImage();
    }
    protected void popupPictureTrimmer1_PopupClose(object sender, PictureTrimmerPopupCloseEventArgs e)
    {
        if (e.SaveChanges)
        {
            // User clicked the "Ok" button

            // Save the cropped image in the file system
            this.popupPictureTrimmer1.SaveProcessedImageToFileSystem(string.Format("~/repository/store/ex_A_305/output/{0}.jpg", RecordID1));

            // Save the PictureTrimmer value in the DB
            using (OleDbConnection connection = ExamplesHelper.GetNewOpenDbConnection())
            {
                using (OleDbCommand command = connection.CreateCommand())
                {
                    command.CommandText = "UPDATE [Ex_A_305] SET [PictureTrimmerValue]=@PictureTrimmerValue  WHERE [Id]=@Id";
                    command.Parameters.AddWithValue("@PictureTrimmerValue", CodeCarvings.Piczard.Serialization.JSONSerializer.SerializeToString(this.popupPictureTrimmer1.Value));
                    command.Parameters.AddWithValue("@Id", RecordID1);
                    command.ExecuteNonQuery();
                }
            }

            // Display the new output image
            this.displayOutputImage1();
        }

        // Unload the image from the control
        this.popupPictureTrimmer1.UnloadImage();
    }
    protected void popupPictureTrimmer3_PopupClose(object sender, PictureTrimmerPopupCloseEventArgs e)
    {
        if (e.SaveChanges)
        {
            // User clicked the "Ok" button

            using (OleDbConnection connection = ExamplesHelper.GetNewOpenDbConnection())
            {
                // Load the source image (this operation is required when temporary files are disabled!)
                byte[] sourceImageBytes;
                using (OleDbCommand command = connection.CreateCommand())
                {
                    command.CommandText = "SELECT [SourceImage] FROM [Ex_A_305] WHERE [Id]=@Id";
                    command.Parameters.AddWithValue("@Id", RecordID3);
                    sourceImageBytes = (byte[])command.ExecuteScalar();
                }

                // Save the PictureTrimmer value and the output image in the DB
                using (OleDbCommand command = connection.CreateCommand())
                {
                    command.CommandText = "UPDATE [Ex_A_305] SET [PictureTrimmerValue]=@PictureTrimmerValue, [OutputImage]=@OutputImage  WHERE [Id]=@Id";
                    command.Parameters.AddWithValue("@PictureTrimmerValue", CodeCarvings.Piczard.Serialization.JSONSerializer.SerializeToString(this.popupPictureTrimmer3.Value));
                    byte[] outputImageBytes = this.popupPictureTrimmer3.SaveProcessedImageToByteArray(sourceImageBytes, new JpegFormatEncoderParams());
                    command.Parameters.AddWithValue("@OutputImage", outputImageBytes);
                    command.Parameters.AddWithValue("@Id", RecordID3);
                    command.ExecuteNonQuery();
                }
            }

            // Display the new output image
            this.displayOutputImage3();
        }

        // Unload the image from the control
        this.popupPictureTrimmer3.UnloadImage();
    }
 protected void PopupPictureTrimmer1_PopupClose(object sender, PictureTrimmerPopupCloseEventArgs e)
 {
     this.MyLogEvent("Popup closed (SaveChanges=" + e.SaveChanges.ToString(System.Globalization.CultureInfo.InvariantCulture) + ").");
 }
    protected void popupPictureTrimmer1_PopupClose(object sender, PictureTrimmerPopupCloseEventArgs e)
    {
        if (e.SaveChanges)
        {
            // User clicked the "Ok" button

            // Save the cropped image in the file system
            this.popupPictureTrimmer1.SaveProcessedImageToFileSystem(string.Format("~/repository/store/ex_A_305/output/{0}.jpg", RecordID1));

            // Save the PictureTrimmer value in the DB
            using (OleDbConnection connection = ExamplesHelper.GetNewOpenDbConnection())
            {
                using (OleDbCommand command = connection.CreateCommand())
                {
                    command.CommandText = "UPDATE [Ex_A_305] SET [PictureTrimmerValue]=@PictureTrimmerValue  WHERE [Id]=@Id";
                    command.Parameters.AddWithValue("@PictureTrimmerValue", CodeCarvings.Piczard.Serialization.JSONSerializer.SerializeToString(this.popupPictureTrimmer1.Value));
                    command.Parameters.AddWithValue("@Id", RecordID1);
                    command.ExecuteNonQuery();
                }
            }

            // Display the new output image
            this.displayOutputImage1();
        }

        // Unload the image from the control
        this.popupPictureTrimmer1.UnloadImage();
    }
    protected void popupPictureTrimmer3_PopupClose(object sender, PictureTrimmerPopupCloseEventArgs e)
    {
        if (e.SaveChanges)
        {
            // User clicked the "Ok" button

            using (OleDbConnection connection = ExamplesHelper.GetNewOpenDbConnection())
            {
                // Load the source image (this operation is required when temporary files are disabled!)
                byte[] sourceImageBytes;
                using (OleDbCommand command = connection.CreateCommand())
                {
                    command.CommandText = "SELECT [SourceImage] FROM [Ex_A_305] WHERE [Id]=@Id";
                    command.Parameters.AddWithValue("@Id", RecordID3);
                    sourceImageBytes = (byte[]) command.ExecuteScalar();
                }

                // Save the PictureTrimmer value and the output image in the DB
                using (OleDbCommand command = connection.CreateCommand())
                {
                    command.CommandText = "UPDATE [Ex_A_305] SET [PictureTrimmerValue]=@PictureTrimmerValue, [OutputImage]=@OutputImage  WHERE [Id]=@Id";
                    command.Parameters.AddWithValue("@PictureTrimmerValue", CodeCarvings.Piczard.Serialization.JSONSerializer.SerializeToString(this.popupPictureTrimmer3.Value));
                    byte[] outputImageBytes = this.popupPictureTrimmer3.SaveProcessedImageToByteArray(sourceImageBytes, new JpegFormatEncoderParams());
                    command.Parameters.AddWithValue("@OutputImage", outputImageBytes);
                    command.Parameters.AddWithValue("@Id", RecordID3);
                    command.ExecuteNonQuery();
                }
            }

            // Display the new output image
            this.displayOutputImage3();
        }

        // Unload the image from the control
        this.popupPictureTrimmer3.UnloadImage();
    }
    protected void popupPictureTrimmer2_PopupClose(object sender, PictureTrimmerPopupCloseEventArgs e)
    {
        if (e.SaveChanges)
        {
            // User clicked the "Ok" button

            // Save the PictureTrimmer value and the output image in the DB
            using (OleDbConnection connection = ExamplesHelper.GetNewOpenDbConnection())
            {
                using (OleDbCommand command = connection.CreateCommand())
                {
                    command.CommandText = "UPDATE [Ex_A_305] SET [PictureTrimmerValue]=@PictureTrimmerValue, [OutputImage]=@OutputImage  WHERE [Id]=@Id";
                    command.Parameters.AddWithValue("@PictureTrimmerValue", CodeCarvings.Piczard.Serialization.JSONSerializer.SerializeToString(this.popupPictureTrimmer2.Value));
                    byte[] outputImageBytes = this.popupPictureTrimmer2.SaveProcessedImageToByteArray(new JpegFormatEncoderParams());
                    command.Parameters.AddWithValue("@OutputImage", outputImageBytes);
                    command.Parameters.AddWithValue("@Id", RecordID2);
                    command.ExecuteNonQuery();
                }
            }

            // Display the new output image
            this.displayOutputImage2();
        }

        // Unload the image from the control
        this.popupPictureTrimmer2.UnloadImage();
    }
Esempio n. 8
0
 protected void PopupPictureTrimmer1_PopupClose(object sender, PictureTrimmerPopupCloseEventArgs e)
 {
     this.MyLogEvent("Popup closed (SaveChanges=" + e.SaveChanges.ToString(System.Globalization.CultureInfo.InvariantCulture) + ").");
 }