Display Control with .Net

<< Click to Display Table of Contents >>

Navigation:  Programming with Common Vision Blox > Compiler specific hints > .NET languages and CVB Programming Hints >

Display Control with .Net

 

The Common Vision Blox Display Control does have two methods that are inherently incompatible with .Net languages:

AddOverlayObject and

AddUserObject.

Both expect the caller to pass the address of the first element of an array as an integer variable, but the Common Language Runtime has no means of determining the actual length of the array for the purpose of marshaling and will only pass one integer value across the managed/unmanaged boundary.

 

To work around this issue, the methods

AddOverlayObjectNet and

AddUserObjectNet

have been added to the Common Vision Blox Display Control that should be used whenever trying to add a user or overlay object to the CV Display Control.

 

Please also note that using user objects in managed code has limitations.
When user objects are being used, the Display control will raise the UserPaint in which the (unmanaged) handle to the display's Device Context is being passed.

To use the drawing functions in System.Drawing this handle can (and needs to) be wrapped in a System.Drawing.Graphics object, but doing so will slightly change the settings of the device context and make e.g. XOR painting impossible.

Therefore user object painting cannot be expected to behave the same way in managed code as it does in unmanaged applications.