Some Issues When Using csXImage with VB.NET

Below are listed some programming techniques that are necessary when using an ActiveX control in VB.NET. They are relevant to the demo that is supplied with csXImage and further description can be found in the readme text file that is supplied with the installer.

  1. 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.
  2. The data type OLE_COLOR used by, for example, the PixelColor property, is equivalent to the data type System.Drawing.Color in VB.NET.
  3. 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.

Some downloadable VB.NET examples:

Cookies

This site uses cookies for functionality, traffic analysis and for targeted advertising. Click the Accept button to accept our Cookie Policy. The Cookie Policy page offers configuration for a reduced set of cookies for this site.