PictureBox Control Zoom

Recently I needed to implement zooming functionality using the mouse wheel in PictureBox control in C#.

My initial reflex was to reuse existing free code, but I kept on running into controls that were either too bulky or badly implemented. In the end I implemented a relatively simple class which can be used with the standard C# PictureBox.

One of the nicer functionalities of this implementation is that the point being scrolled under the cursor will stay in place during zooming in/out.

The heart of this class is the following function:

Read more