Zoom Image In C#
hi I am writting a program. there is two picturebox in it. one is containing a full image and another one is small one and should contain part of full image mouse points in big picturebox. I just want to implement a zoom feature with fixed ratio that show part of image under mouse cursor in big picturbox into the 开发者_JS百科small picturebox.
I just want a Bitmap exactly size of my small picturebox witch has the zoomed Image.
PS: I don't want to use any additional libraries.
I don't want to resize my pictureboxes' sizes.
You can create a new Bitmap
of the desired size, call Graphics.FromImage
to get a Graphics
object that draws on it, then call the DrawImage
overload that takes two rectangles.
This overload takes a portion of the source image to draw and the bounds in the target image to scale it to.
精彩评论