public DrawImageUnscaledAndClipped ( Image image, |
||
image | Image | |
rect | ||
return | void |
using System.Drawing; // Load the image Image img = Image.FromFile(@"C:\Images\example.jpg"); // Draw the image onto a form Graphics g = this.CreateGraphics(); Rectangle clipRect = new Rectangle(0, 0, 100, 100); g.DrawImageUnscaledAndClipped(img, clipRect);
using System.Drawing; // Load the image Image img = Image.FromFile(@"C:\Images\example.jpg"); // Create a bitmap to draw onto Bitmap bmp = new Bitmap(500, 500); // Draw the image onto the bitmap Graphics g = Graphics.FromImage(bmp); Rectangle clipRect = new Rectangle(0, 0, 200, 200); g.DrawImageUnscaledAndClipped(img, clipRect);The examples above use the System.Drawing library in C#.
public DrawImageUnscaledAndClipped ( Image image, |
||
image | Image | |
rect | ||
return | void |