@@ -233,25 +233,20 @@ private void pictureBoxMouseCanvas_MouseUp(object sender, MouseEventArgs e)
233233 /// <returns>Returns a bitmap image based on X, Y, Width, and Height.</returns>
234234 private Bitmap SelectBitmap ( )
235235 {
236- if ( _selectWidth > 0 )
237- {
238- Rectangle rect = new Rectangle ( _selectX , _selectY , _selectWidth , _selectHeight ) ;
239- Bitmap bitmapDestination = new Bitmap ( pictureBoxMouseCanvas . Image , pictureBoxMouseCanvas . Width , pictureBoxMouseCanvas . Height ) ;
236+ Rectangle rect = new Rectangle ( _selectX , _selectY , _selectWidth , _selectHeight ) ;
237+ Bitmap bitmapDestination = new Bitmap ( pictureBoxMouseCanvas . Image , pictureBoxMouseCanvas . Width , pictureBoxMouseCanvas . Height ) ;
240238
241- Bitmap bitmapSource = new Bitmap ( _selectWidth , _selectHeight ) ;
239+ Bitmap bitmapSource = new Bitmap ( _selectWidth , _selectHeight ) ;
242240
243- using ( Graphics g = Graphics . FromImage ( bitmapSource ) )
244- {
245- g . InterpolationMode = InterpolationMode . HighQualityBicubic ;
246- g . PixelOffsetMode = PixelOffsetMode . HighQuality ;
247- g . CompositingQuality = CompositingQuality . HighQuality ;
248- g . DrawImage ( bitmapDestination , Left , Top , rect , GraphicsUnit . Pixel ) ;
249- }
250-
251- return bitmapSource ;
241+ using ( Graphics g = Graphics . FromImage ( bitmapSource ) )
242+ {
243+ g . InterpolationMode = InterpolationMode . HighQualityBicubic ;
244+ g . PixelOffsetMode = PixelOffsetMode . HighQuality ;
245+ g . CompositingQuality = CompositingQuality . HighQuality ;
246+ g . DrawImage ( bitmapDestination , Left , Top , rect , GraphicsUnit . Pixel ) ;
252247 }
253248
254- return null ;
249+ return bitmapSource ;
255250 }
256251
257252 /// <summary>
0 commit comments