Graphics.DrawImageUnscaled Method
Draws the specified image using its original physical size at the location specified by a coordinate pair.
Overload List
Draws a specified image using its original physical size at a specified location.
[Visual Basic] Overloads Public Sub DrawImageUnscaled(Image, Point)
[C#] public void DrawImageUnscaled(Image, Point);
[C++] public: void DrawImageUnscaled(Image*, Point);
[JScript] public function DrawImageUnscaled(Image, Point);
Draws a specified image using its original physical size at a specified location.
[Visual Basic] Overloads Public Sub DrawImageUnscaled(Image, Rectangle)
[C#] public void DrawImageUnscaled(Image, Rectangle);
[C++] public: void DrawImageUnscaled(Image*, Rectangle);
[JScript] public function DrawImageUnscaled(Image, Rectangle);
Draws the specified image using its original physical size at the location specified by a coordinate pair.
[Visual Basic] Overloads Public Sub DrawImageUnscaled(Image, Integer, Integer)
[C#] public void DrawImageUnscaled(Image, int, int);
[C++] public: void DrawImageUnscaled(Image*, int, int);
[JScript] public function DrawImageUnscaled(Image, int, int);
Draws a specified image using its original physical size at a specified location.
[Visual Basic] Overloads Public Sub DrawImageUnscaled(Image, Integer, Integer, Integer, Integer)
[C#] public void DrawImageUnscaled(Image, int, int, int, int);
[C++] public: void DrawImageUnscaled(Image*, int, int, int, int);
[JScript] public function DrawImageUnscaled(Image, int, int, int, int);
Example
[Visual Basic, C#] The following example is designed for use with Windows Forms, and it requires PaintEventArgs e, which is a parameter of the Paint event handler. The code performs the following actions:
- Creates an image from a JPEG file, SampImag.jpg, in the folder of the example.
- Creates a point at which to draw the upper-left corner of the image.
- Draws the entire image using its physical size.
[Visual Basic, C#] Note This example shows how to use one of the overloaded versions of DrawImageUnscaled. For other examples that might be available, see the individual overload topics.
[Visual Basic] Public Sub DrawImageUnscaledInt(e As PaintEventArgs) ' Create image. Dim newImage As Image = Image.FromFile("SampImag.jpg") ' Create coordinates for upper-left corner of image. Dim x As Integer = 100 Dim y As Integer = 100 ' Draw image to screen. e.Graphics.DrawImageUnscaled(newImage, x, y) End Sub [C#] public void DrawImageUnscaledInt(PaintEventArgs e) { // Create image. Image newImage = Image.FromFile("SampImag.jpg"); // Create coordinates for upper-left corner of image. int x = 100; int y = 100; // Draw image to screen. e.Graphics.DrawImageUnscaled(newImage, x, y); }
[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button
in the upper-left corner of the page.
See Also
Graphics Class | Graphics Members | System.Drawing Namespace