Image processing with VB.NET - A Demo using ActiveX control csXImage
The trial installer for csXImage contains a sample VB.NET project to demonstrate some of the supported features. This example also demonstrates
a few special programming techniques that are necessary when using an ActiveX control in VB.NET.
- VB.NET cannot directly recognise indexed properties of ActiveX controls, such as the PixelColor property of csXImage. To use these properties,
the property name must be prefixed by get_ (to read the property) or by set_ (to write the property). For example, get_PixelColor is used in
Sub AxImageBox1_OnMouseMove to read the colour of the pixel under the cursor.
- The data type OLE_COLOR used by, for example, the PixelColor property, is equivalent to the data type System.Drawing.Color in VB.NET.
- In VB.NET, the OnMouseMove event is only triggered if the ImageBox control has the Focus. One effect of this is to prevent the crosshair
cursor used by the MouseSelectRectangle and MouseSelectEllipse functions from automatically displaying when the mouse is moved over the control.
This issue is solved by adding the line AxImageBox1.Focus( ) as required.
More information on each of the above is given in the readme.txt file, contained in the zip file. The specific piece of code which demonstrates
the technique is referred to in each case.
Other downloadable examples:
- Zoom - An example of zooming an image.
- File Info - An example of editing IPTC text and EXIF data.
- Rubber Band - Drawing a line with "Rubber Banding".
- Selecting an area - Drawing a selection area with "Rubber Banding".
- Unicode - An example of adding text to an image in Unicode characters.
- TWAIN - An example of capturing an image from a TWAIN compliant scanner or camera.
- ADF - An example of scanning multiple images from a scanner with an Auto Document Feed.
- Multi-page TIFF - View edit or scan multi-page TIFF images.
© Chestysoft, 2013.