Results 1 to 4 of 4

Thread: Code of Calling Sub VB.NET

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jun 2017
    Posts
    165

    Code of Calling Sub VB.NET

    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.

    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
    Like this :

    Code:
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            DrawImageRectRect(?, ?)
        End Sub
    Last edited by ebellounisoft; Aug 14th, 2017 at 05:46 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width