Hello Community,
I was wondering if there is a way to get only the visible section of the image from picturebox1 and place it in picturebox2.

So what I have is picturebox1 set to a certain size, and the image size mode is set to center. Picturebox2 is also set to a certain size but the size mode is set to sketch. In the example I've attached the dash line represents the border of picturebox1. So what is on the inside is what I want moved to the second picturebox. Note all the images in going in picturebox1, most of them won't be the same size.

Attachments Example.png 81.74 KB

Maybe this is what you want?

Dim x As Integer = PictureBox1.Width
        Dim y As Integer = PictureBox1.Height
        Dim bm As New Bitmap(x, y)

        PictureBox1.DrawToBitmap(bm, New Rectangle(0, 0, x, y))

        PictureBox2.Image = bm
Attachments 2.jpg 29.74 KB
This question has already been answered. Start a new discussion instead.