Ejemplo n.º 1
0
        /// <summary>
        /// Dispose of the CurrentBitmap and replace it with the given bitmap.
        /// </summary>
        /// <param name="bmp">The new bitmap.</param>
        public void ReplaceBitmap(Bitmap bmp)
        {
            if (CurrentBitmap != null)
            {
                CurrentBitmap.Dispose();
            }

            CurrentBitmap = IMAGE.ProperCast(bmp, this.Format);
        }
Ejemplo n.º 2
0
        private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Error != null)
            {
                MessageBox.Show("Failed to transform image. " + e.Error.GetBaseException().Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (!e.Cancelled)
            {
                ibMain.Image = IMAGE.ProperCast(e.Result as Bitmap, originalImage.GetImageFormat());
            }

            Cursor.Current     = Cursors.Default;
            this.UseWaitCursor = false;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Sets the CurrentBitmap and does not dispose of the last bitmap.
 /// </summary>
 /// <param name="bmp">The new bitmap.</param>
 public void UpdateBitmapReferance(Bitmap bmp)
 {
     CurrentBitmap = IMAGE.ProperCast(bmp, this.Format);
 }