This interface provide functionalities of the display control. More...
Public Member Functions | |
int | AddInteractableObject (IDispatch *interactable, int drawFlags) |
int | AddObject (IDispatch *drawable, int drawFlags) |
int | AddRegion (IDispatch *region, BOOL interactable) |
void | ClientToImage (int x, int y, double *imageX, double *imageY) |
void | FitInViewObject (IDispatch *object, LPVAlignment alignFlags) |
IDispatch * | GetImage () |
IDispatch * | GetObjectByID (int objectId) |
IDispatch * | GetRegionByID (int regionId) |
void | ImageToClient (double imageX, double imageY, int *x, int *y) |
void | RemoveAllObjects () |
void | RemoveAllRegions () |
void | RemoveImage () |
void | RemoveObject (IDispatch *drawable) |
void | RemoveObjectByID (int objectId) |
void | RemoveRegion (IDispatch *region) |
void | RemoveRegionByID (int regionId) |
void | SetImage (IDispatch *image) |
Public Member Functions inherited from ILDisplayCommon | |
int | AddReferenceLineH (double position, double relativePosition, BOOL attached, OLE_COLOR clr) |
int | AddReferenceLineV (double position, double relativePosition, BOOL attached, OLE_COLOR clr) |
void | FitInView (int tlx, int tly, int w, int h, LPVAlignment alignFlags) |
void | FitToWindow (LPVAlignment alignFlags) |
void | Refresh () |
void | RefreshImmediate () |
void | RemoveAllReferenceLine () |
void | RemoveReferenceLine (int refLineId) |
int | SaveSceneToFile (BSTR filename, double zoomX, double zoomY) |
int | SaveWindowToFile (BSTR filename) |
void | SetDisplayFlag (LPVDisplayFlags flag, BOOL enable) |
void | SetSize (int w, int h) |
void | ShowDialog (BSTR dialogName, int x, int y, int w, int h) |
void | ShowDialogAsync (BSTR dialogName, int x, int y, int w, int h, int refreshInterval) |
Properties | |
BOOL | KeepAspectRatio [get, set] |
Whether the display control should keep the aspect ratio when zooming. | |
int | PixelUnderMouse [get] |
The pixel value under current cursor's position. | |
Properties inherited from ILDisplayCommon | |
LPVAlignment | Alignment [get, set] |
The alignment the control is used when fit some part of the scene to the window. | |
BOOL | AutoRefreshEnabled [get, set] |
Enables or disables automatically display re-rendering triggered by add/remove objects or regions or the image. By default, it's on. | |
OLE_COLOR | BackColor [get, set] |
The background color of the display control. | |
LPVDisplayFlags | DisplayFlags [get, set] |
The display flags, see LPVDisplayFlags. | |
BOOL | DrawingEnabled [get, set] |
Enables or disables all display rendering. Useful when performing many graphics or image operations at once. | |
LPVScrollBarPolicy | HScrollBarPolicy [get, set] |
The policy of the horizontal scroll bar, see LPVScrollBarPolicy. | |
double | PanX [get, set] |
The scene's translation in the x-coordinate direction for panning. The final display x position is calculated as: \( (x + panX) \times zoomX \). | |
double | PanY [get, set] |
The scene's translation in the y-coordinate direction for panning. The final display y position is calculated as: \( (y + panY) \times zoomY \). | |
LPVScrollBarPolicy | VScrollBarPolicy [get, set] |
The policy of the vertical scroll bar, see LPVScrollBarPolicy. | |
double | Zoom [set] |
Set the scene's zoom factor in both x- and y-coordinate direction. | |
LPVZoomAnchor | ZoomAnchor [get, set] |
How the control should position the scene when resized, see LPVZoomAnchor. | |
double | ZoomX [get, set] |
The scene's zoom factor in or out in the x-coordinate direction. | |
double | ZoomY [get, set] |
The scene's zoom factor in or out in the y-coordinate direction. | |
This interface provide functionalities of the display control.
Usually you add the display control via the Toolbox in Visual Studio. This interface helps you to manage the scene in the display control, for the image, regions, geometric primitives and algorithms' results to shown in the control.
See ILDisplayEvents for the control's event.
Note: This interface is currently not available on Linux / MacOS platform.
int AddInteractableObject | ( | IDispatch * | interactable, |
int | drawFlags | ||
) |
Add the interactable item to the scene. It's usually a geometric primitive.
[in] | interactable | The object item, it should be a geometric primitive object implemented the ILGeomObject interface and also ILDrawable interface. |
[in] | drawFlags | The draw flags to control the item's drawing behavior. |
objectId | Return the ID of the new item in the scene. |
int AddObject | ( | IDispatch * | drawable, |
int | drawFlags | ||
) |
Add the drawable item to the scene. It's usually a geometric primitive or some algorithm' results.
[in] | drawable | The object item, it should be an object implemented the ILDrawable interface, or LText object. |
[in] | drawFlags | The draw flags to control the item's drawing behavior. |
objectId | Return the ID of the new item in the scene. |
int AddRegion | ( | IDispatch * | region, |
BOOL | interactable | ||
) |
Add the region item to the scene.
[in] | region | The region item, it should be a LRegion instance. |
[in] | interactable | Whether the region object is interactable. By default, it's True. |
regionId | Return the ID of the new item in the scene. |
void ClientToImage | ( | int | x, |
int | y, | ||
double * | imageX, | ||
double * | imageY | ||
) |
Map the position from the display control's client coordinates to the images' coordinates.
[in] | x | The x-coordinate of the position, relative to the upper-left corner of the display control's client area. |
[in] | y | The y-coordinate of the position, relative to the upper-left corner of the display control's client area. |
[out] | imageX | Output the x-coordinate of the transformed position, relative to the upper-left corner of the image. |
[out] | imageY | Output the y-coordinate of the transformed position, relative to the upper-left corner of the image. |
void FitInViewObject | ( | IDispatch * | object, |
LPVAlignment | alignFlags | ||
) |
Zoom and translate the scene, to view the specified object and fit the window.
[in] | object | The object item to view. |
[in] | alignFlags | The alignment, the control's Alignment property is used if it's not set. |
IDispatch* GetImage | ( | ) |
Get the image of the scene.
image | Return the image object |
IDispatch* GetObjectByID | ( | int | objectId | ) |
Get the drawable item by its ID in the scene
[in] | objectId | The drawable item's ID. |
drawable | Return the object item |
IDispatch* GetRegionByID | ( | int | regionId | ) |
Get the region item by its ID in the scene
[in] | regionId | The region item's ID. |
region | Return the region item |
void ImageToClient | ( | double | imageX, |
double | imageY, | ||
int * | x, | ||
int * | y | ||
) |
Map the position from the images' coordinates to the display control's client coordinates.
[in] | imageX | The x-coordinate of the position, relative to the upper-left corner of the image. |
[in] | imageY | The y-coordinate of the position, relative to the upper-left corner of the image. |
[out] | x | Output the x-coordinate of the transformed position, relative to the upper-left corner of the display control's client area |
[out] | y | Output the y-coordinate of the transformed position, relative to the upper-left corner of the display control's client area |
void RemoveAllObjects | ( | ) |
Remove all drawable items from the scene.
void RemoveAllRegions | ( | ) |
Remove all region items from the scene.
void RemoveImage | ( | ) |
Remove the image from the scene. The current scene size is retained.
void RemoveObject | ( | IDispatch * | drawable | ) |
Remove the drawable item from the scene.
[in] | drawable | The drawable item to be removed. |
void RemoveObjectByID | ( | int | objectId | ) |
Remove the drawable item from the scene, by its ID.
[in] | objectId | The drawable item's ID. |
void RemoveRegion | ( | IDispatch * | region | ) |
Remove the region item from the scene.
[in] | region | The region item to be removed. |
void RemoveRegionByID | ( | int | regionId | ) |
Remove the region item from the scene, by its ID.
[in] | regionId | The region item's ID. |
void SetImage | ( | IDispatch * | image | ) |
Set the image of the scene. The size of the scene is extended to the image size.
[in] | image | The image item, it should be a LImage instance. |