2011-09-03 18 views

Odpowiedz

19

Zastosowanie Bitmap.Clone(Rectangle, PixelFormat), tutaj możemy ustawić PixelFormat nowego obrazu i rozmiar prostokąta

// Create a Bitmap object from a file. 
Bitmap myBitmap = new Bitmap("Grapes.jpg"); 

// Clone a portion of the Bitmap object. 
Rectangle cloneRect = new Rectangle(0, 0, 100, 100); 
System.Drawing.Imaging.PixelFormat format = 
    myBitmap.PixelFormat; 
Bitmap cloneBitmap = myBitmap.Clone(cloneRect, format); 

// Draw the cloned portion of the Bitmap object. 
e.Graphics.DrawImage(cloneBitmap, 0, 0); 
+0

Co to PixelFormat za? – Bosak

+0

możemy określić nowy format pikseli obrazu – Damith

Powiązane problemy