Does anyone know how to zoom/pan (scroll) on the imagebox of EmguCV using C# code? It works just fine using mouse scroll, But I'd like to do it using code.
I tried this, but with no luck!
ImageBox1.SetZoomScale(1, new Point(400, 400));
With SetZoomScale you are on the right way. Set a zoom scale grater than 1 to zoom in and a zoom scale smaller than 1 to zoom out. 1 means no zoom. The second parameter is the center of the zoomed area relative to the image control. So, if you start with a ZoomScale = 1 do the following:
Zoom in with fix point (400,00)
ImageBox1.SetZoomScale(2, new Point(400, 400));
Reset original zoom
ImageBox1.SetZoomScale(1, new Point(400, 400));
Zoom out with fix point (400,00)
ImageBox1.SetZoomScale(0.5, new Point(400, 400));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.