Do not know how to call a Function with this code from a button_Click Sub. I use DrawImageRectRect() in the Click event but what will be the arguments ?. Thank you.
Like this :Code:Private Sub DrawImageRectRect(ByVal e As PaintEventArgs) ' Create image. Dim newImage As Image = Image.FromFile("SampImag.jpg") ' Create rectangle for displaying image. Dim destRect As New Rectangle(100, 100, 450, 150) ' Create rectangle for source image. Dim srcRect As New Rectangle(50, 50, 150, 150) Dim units As GraphicsUnit = GraphicsUnit.Pixel ' Draw image to screen. e.Graphics.DrawImage(newImage, destRect, srcRect, units) End Sub
Code:Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click DrawImageRectRect(?, ?) End Sub




Reply With Quote
