New to Telerik UI for WinForms? Download free 30-day trial

Pan and Zoom

In RadPictureBox you can easily pan, zoom in or out. The horizontal and vertical scrollbars help navigating to the visible area of the control.

RadPictureBox exposes ZoomProperties property that is responsible for the zoom operations. In order to enable zooming you should set AllowZoom to true. To start zooming you need to hold down the Ctrl key and use the mouse wheel. In order to start a panning operation you can drag the view port with the mouse. The pan operation is triggered by a user interaction.

Enable pan and zoom

this.radPictureBox1.ShowScrollBars = false;

Me.RadPictureBox1.ShowScrollBars = False

picturebox-edit001

If you do not what the scrollbars to be displayed you can disable them. Thus, the user can navigate to the visible area of the control just by using the mouse or via touch gestures.

Disable scrollbars

this.radPictureBox1.ShowScrollBars = false;

Me.RadPictureBox1.ShowScrollBars = False

Zoom properties

The zooming can be controlled through the following useful properties:

  • ZoomStep: Gets or sets the step that increments or decrements the element during a zoom operation with the mouse. Cannot have negative value.

  • ZoomFactor: Gets or sets the current zoom factor.

  • MaxZoomFactor: Gets or sets the maximal zoom factor.

  • MinZoomFactor: Gets or sets the minimal zoom factor.

Zoom programatically

The control exposes an API for zooming programmatically.

  • The Zoom method performs a zoom operation by given steps count:
this.radPictureBox1.ZoomProperties.Zoom(5);

Me.RadPictureBox1.ZoomProperties.Zoom(5)

  • The ZoomIn method performs a zoom-in operation with one step, according to the ZoomStep value. This method has an overload that performs a zoom-in according to the ZoomStep value operation with a specified count of steps:
this.radPictureBox1.ZoomProperties.ZoomIn();
this.radPictureBox1.ZoomProperties.ZoomIn(5);

Me.RadPictureBox1.ZoomProperties.ZoomIn()
Me.RadPictureBox1.ZoomProperties.ZoomIn(5)

  • The ZoomOut method performs a zoom-out operation with one step, according to the ZoomStep value. This method has an overload that performs a zoom-out according to the ZoomStep value operation with a specified count of steps:
this.radPictureBox1.ZoomProperties.ZoomOut();
this.radPictureBox1.ZoomProperties.ZoomOut(5);

Me.RadPictureBox1.ZoomProperties.ZoomOut()
Me.RadPictureBox1.ZoomProperties.ZoomOut(5)

You can also reset all the zoom settings by calling the ResetZoom method.

See Also

In this article
Not finding the help you need? Improve this article