Demo using the Zoom function of csXImage in Visual Basic

This demo application uses two instances of the csXImage control on a single VB form. An image file can be loaded into the right-hand control (ImageBox2) by using the "Load File" command button. This image is automatically duplicated in the left-hand control (ImageBox1).

Two other command buttons are provided, for "Zoom In" and "Zoom Out". The code executed by these buttons will increase or decrease the value of the Zoom property by 10% each time. ImageBox2 will be zoomed in or out.

The image in ImageBox1 is automatically updated either when ImageBox2 is zoomed, or scrolled. Scrolling is detected by using the OnScroll event. The coordinates of a rectangle that represent the visible part of the image in ImageBox2 are calculated and this rectangle is drawn on ImageBox1 and highlighted by adjusting the brightness of this section of the image.

Image zoom in Visual Basic

This demo is available in two versions: one for use with Visual Basic 5 or 6, the other for use with Visual Basic.NET. The appropriate version can be downloaded from the links below.

Visual Basic.NET

To run this demo you need the csXImage trial ocx control installed on your system as well as MS Visual Studio.NET. The trial control and the example files are available below:

Download the trial csXImage control - csXImageTrial.exe (3 MB)

The demo VB.NET project - ZoomDemoVBNET.zip (64 KB)

Description and listing of the project code.

Visual Basic 5 or 6

To run this demo you need the csXImage trial ocx control installed on your system as well as MS Visual Basic 5 or 6. The trial control and the example files are available below:

Download the trial csXImage control - csXImageTrial.exe (3 MB)

The demo VB project - ZoomDemo.zip (4 KB)

Description and listing of the project code.