The features described in this topic are obsolete
and should not be used in new IDL code.
Handling Events within Visual Basic
The VBPaint example uses direct graphics to create a simple drawing program. A direct graphics window is used to respond to events within VB. Each click event will get the (x,y) location within the window, and modify the color of the current pixel in the image. See the following figure:.
This example illustrates the following concepts:
- Converting from a VB pixel coordinate system to the IDL coordinate system;
- Converting a VB color representation (long) into an IDL color representation (RGB);
- Modifying an IDL RGB color table item with a color chosen/created from VB and the Window's common color dialog;
- Processing mouse events within VB to draw into an IDL window
.
Example Code
See the files located in the examples\docs\ActiveX\VBPaint directory of the IDL installation directory for example code.
