NOTE: Draw functions and LDisplay Control is now only implemented on Windows. For others (Mac / Linux), the functions and related interfaces are retained but non-functional.
For the image and the drawable LPV classes which implements the ILDrawable interface, we usually provide the Draw functions to paint the class's content on the provided device context, aka. the HDC handle.
It is a more flexible and light-weighted API for the users to fully control the graphics rendering of their applications, compared with the LDisplay Control.
Here are some example draw functions for the image, region and detection results:
They have the common parameters for specifying the drawing device context and controlling the view port.
[in] | hdc | Handle to the device context of the destination window or bitmap. |
[in] | zoomX | Factor for zooming in or out in the x-coordinate direction. By default, it's 1, means the true 100% scale. |
[in] | zoomY | Factor for zooming in or out in the y-coordinate direction. Setting to 0 means same zoom factor as zoomX, aka. isotropic scaling. |
[in] | panX | translation in the x-coordinate direction for panning. The final display x position is calculated as: \( (x + panX) \times zoomX \) |
[in] | panY | translation in the y-coordinate direction for panning. The final display y position is calculated as: \( (y + panY) \times zoomY \) |
They may also have the extra parameters to control drawing behavior.