Graphics.DrawImageUnscaledAndClipped(Image, Rectangle) Graphics.DrawImageUnscaledAndClipped(Image, Rectangle) Graphics.DrawImageUnscaledAndClipped(Image, Rectangle) Method

정의

지정된 사각형에 맞게 이미지 크기를 조정하여 클리핑하지 않고 지정된 이미지를 그립니다.Draws the specified image without scaling and clips it, if necessary, to fit in the specified rectangle.

public:
 void DrawImageUnscaledAndClipped(System::Drawing::Image ^ image, System::Drawing::Rectangle rect);
public void DrawImageUnscaledAndClipped (System.Drawing.Image image, System.Drawing.Rectangle rect);
member this.DrawImageUnscaledAndClipped : System.Drawing.Image * System.Drawing.Rectangle -> unit

매개 변수

image
Image Image Image

그릴 Image입니다.The Image to draw.

rect
Rectangle Rectangle Rectangle

이미지가 그려질 Rectangle입니다.The Rectangle in which to draw the image.

예외

imagenull입니다.image is null.

예제

다음 예제에서는 DrawImageUnscaledAndClipped 메서드를 사용하는 방법을 보여 줍니다.The following example demonstrates how to use the DrawImageUnscaledAndClipped method. 이 예제를 실행 하려면 Windows 폼에 붙여 넣습니다.To run this example, paste it into a Windows Form. 양식의 처리 Paint 이벤트 및 호출 합니다 DrawImageUnscaled 메서드에서 Paint 전달 하는 이벤트 처리 메서드를 e 으로 PaintEventArgs입니다.Handle the form's Paint event and call the DrawImageUnscaled method from the Paint event-handling method, passing e as PaintEventArgs.

private void DrawImageUnscaled(PaintEventArgs e)
{
    string filepath = @"C:\Documents and Settings\All Users\Documents\" + 
        @"My Pictures\Sample Pictures\Water Lilies.jpg";
    Bitmap bitmap1 = new Bitmap(filepath);
    e.Graphics.DrawImageUnscaledAndClipped(bitmap1, new Rectangle(10,10,250,250));
}
Private Sub DrawImageUnscaled(ByVal e As PaintEventArgs) 
    Dim filepath As String = "C:\Documents and Settings\All Users\Documents\" _
        & "My Pictures\Sample Pictures\Water Lilies.jpg"
    Dim bitmap1 As New Bitmap(filepath)
    e.Graphics.DrawImageUnscaledAndClipped(bitmap1, _
        New Rectangle(10, 10, 250, 250))
End Sub

적용 대상