When you load an image into a PictureBox there is a zoom for the image placement, how do I achieve that same effect with a graphics object?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
I think you mean you want to draw some
Image
yourself in aRectangle
and using someGraphics
object like as thePictureBox
renders its Image inZoom
mode. Try the following code. I suppose you want to draw theImage
on a Form, the drawing code should be added in aPaint
event handler of your form:To test it on your form perfectly, you should also have to set
ResizeRedraw = true
and enableDoubleBuffered
: