I am trying to take a rectangle from the image of picturebox1 and draw it into another rectangle. To make it simple, I have 2 rectangles that are the same size and location as the mouse position, in the picturebox1.mousemove event. I use this:
This works. It draws the image the rectangleR is over onto the rectangleS. The vertical measurements are right on, But the left to right demensions are shifted or smaller. Is it because the picturebox is taller than it is wider? Is it the GraphicsUnit.Pixel? I dont get why it is behaving this way.
VB.NET:
dim g as Picturebox1.CreateGraphics
dim ImageBoxR, ImageBoxS as rectangle
ImageBoxR = New Rectangle(e.x,e.y,100,100)
ImageBoxS = New Rectangle(e,x,e.y,100,100)
g.drawimage(picturebox1.image, ImageBoxR, ImageBoxS, GraphicsUnit.Pixel)
Last edited by a moderator: