I've accomplished the zoom in using images. And I've used this:
The problem is that I've shape controls (rectangle and lines) in the picture box and I want to zoom in / zoom out them. I've tried different codes, but at the moment I'm still searching the solution.Code:Public Sub ZoomImage(ByRef ZoomValue As Int32) Dim original As Image 'Get our original image original = PictureBox1.Image 'Create a new image based on the zoom parameters we require Dim zoomImage As New Bitmap(original, (Convert.ToInt32(original.Width * ZoomValue) / 100), (Convert.ToInt32(original.Height * ZoomValue / 100))) 'Create a new graphics object based on the new image Dim converted As Graphics = Graphics.FromImage(zoomImage) 'Clean up the image converted.InterpolationMode = InterpolationMode.HighQualityBicubic 'Clear out the original image PictureBox1.Image = Nothing 'Display the new "zoomed" image PictureBox1.Image = zoomImage End Sub




Reply With Quote
