Graphics.DrawImageUnscaledAndClipped(Image, Rectangle) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Desenha a imagem especificada sem escalonamento e recorta-a, se necessário, para caber no retângulo especificado.
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
Public Sub DrawImageUnscaledAndClipped (image As Image, rect As Rectangle)
Parâmetros
Exceções
image é null.
Exemplos
O exemplo seguinte demonstra como usar o DrawImageUnscaledAndClipped método. Para executar este exemplo, cole-o num formulário do Windows. Trate o evento do Paint formulário e chame o DrawImageUnscaled método a partir do Paint método de gestão de eventos, passando e como 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