This interface provide basic functionalities of the display controls. More...
Public Member Functions | |
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 | |
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 basic functionalities of the display controls.
This is a base interface for all kinds of display controls. For different chosen control, the implementation varies.
To use this interface, you should create a display control, such as:
LDisplay...
Note: This interface is currently not available on Linux / MacOS platform.
int AddReferenceLineH | ( | double | position, |
double | relativePosition, | ||
BOOL | attached, | ||
OLE_COLOR | clr | ||
) |
Add a horizontal reference line.
[in] | position | The y-coordinate of the reference line |
[in] | relativePosition | The relative y-coordinate of the reference line, which is calculated on the fly based on the image size. The value range is 0 ~ 1, negative value means it's not working. |
[in] | attached | Whether the reference line is attached to the image. Attached reference lines moves together with the image. |
[in] | clr | The color of the reference line, the default value is blue |
refLineId | Return the ID of the new reference line in the scene. |
int AddReferenceLineV | ( | double | position, |
double | relativePosition, | ||
BOOL | attached, | ||
OLE_COLOR | clr | ||
) |
Add a vertical reference line.
[in] | position | The x-coordinate of the reference line |
[in] | relativePosition | The relative x-coordinate of the reference line, which is calculated on the fly based on the image size. The value range is 0 ~ 1, negative value means it's not working. |
[in] | attached | Whether the reference line is attached to the image. Attached reference lines moves together with the image. |
[in] | clr | The color of the reference line, the default value is blue |
refLineId | Return the ID of the new reference line in the scene. |
void FitInView | ( | int | tlx, |
int | tly, | ||
int | w, | ||
int | h, | ||
LPVAlignment | alignFlags | ||
) |
Zoom and translate the scene, to view the specified rectangle region and fit the window.
[in] | tlx | The x-coordinate of the top-left corner of the rectangle region, aka. left border, in pixel unit. |
[in] | tly | The y-coordinate of the top-left corner of the rectangle region, aka. top border, in pixel unit. |
[in] | w | The width of the rectangle region, in pixel unit. |
[in] | h | The height of the rectangle region, in pixel unit. |
[in] | alignFlags | The alignment, the control's Alignment property is used if it's not set. |
void FitToWindow | ( | LPVAlignment | alignFlags | ) |
Zoom and translate the scene, to view the entire scene and fit the window.
[in] | alignFlags | The alignment, the control's Alignment property is used if it's not set. |
void Refresh | ( | ) |
Refresh the scene and redraw the window, request a delayed repaint by the message loop system.
void RefreshImmediate | ( | ) |
Refresh the scene and redraw the window immediately.
void RemoveAllReferenceLine | ( | ) |
Remove all reference lines from the scene.
void RemoveReferenceLine | ( | int | refLineId | ) |
Remove the reference line from the scene, by its ID.
[in] | refLineId | The reference line's ID. |
int SaveSceneToFile | ( | BSTR | filename, |
double | zoomX, | ||
double | zoomY | ||
) |
Save the entire scene to file as a color image. The image size is the same as the zoomed scene size. The image format is chosen based on the filename extension (.bmp, .png, .jpg, etc.).
[in] | filename | Full path of the file, it could be absolute or relative path with file name and extension. |
[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. |
error | Return error code if anything is wrong. see LPVErrorCode. |
int SaveWindowToFile | ( | BSTR | filename | ) |
Save the snapshot of the window to file as a color image. The image size is the same as the window size. The image format is chosen based on the filename extension (.bmp, .png, .jpg, etc.).
[in] | filename | Full path of the file, it could be absolute or relative path with file name and extension. |
error | Return error code if anything is wrong. see LPVErrorCode. |
void SetDisplayFlag | ( | LPVDisplayFlags | flag, |
BOOL | enable | ||
) |
Enable / disable display flags for the control.
[in] | flag | The display flag to be changed. |
[in] | enable | Enables or disable the display flag. |
void SetSize | ( | int | w, |
int | h | ||
) |
Set the size of the scene, in pixel unit.
[in] | w | The width of the scene. |
[in] | h | The height of the scene. |
void ShowDialog | ( | BSTR | dialogName, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) |
Show the display control as a pop-up dialog. It's commonly used in a console application for debugging.
[in] | dialogName | The name of the dialog, shown in title bar. |
[in] | x | The x-coordinate of the window |
[in] | y | The y-coordinate of the window |
[in] | w | The width of the window |
[in] | h | The height of the window |
void ShowDialogAsync | ( | BSTR | dialogName, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
int | refreshInterval | ||
) |
Show the display control as a pop-up dialog and asynchronously working in another thread. It's commonly used in a console application for debugging.
[in] | dialogName | The name of the dialog, shown in title bar. |
[in] | x | The x-coordinate of the window |
[in] | y | The y-coordinate of the window |
[in] | w | The width of the window |
[in] | h | The height of the window |
[in] | refreshInterval | The interval that the dialog is refreshed in microseconds. |