Пример #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);
        }
Пример #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;
        }
Пример #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);
 }