Leaper Vision Toolkit
中文 / English 2.x
Public Member Functions | Properties
ILDisplayCommon Interface Reference

This interface provide basic functionalities of the display controls. More...

Inheritance diagram for ILDisplayCommon:
ILDisplay LDisplay

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: @math_eq{(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: @math_eq{(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.
 

Detailed Description

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.

Member Function Documentation

◆ AddReferenceLineH()

int AddReferenceLineH ( double  position,
double  relativePosition,
BOOL  attached,
OLE_COLOR  clr 
)

Add a horizontal reference line.

Parameters
[in]positionThe y-coordinate of the reference line
[in]relativePositionThe 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]attachedWhether the reference line is attached to the image. Attached reference lines moves together with the image.
[in]clrThe color of the reference line, the default value is blue
Return values
refLineIdReturn the ID of the new reference line in the scene.

◆ AddReferenceLineV()

int AddReferenceLineV ( double  position,
double  relativePosition,
BOOL  attached,
OLE_COLOR  clr 
)

Add a vertical reference line.

Parameters
[in]positionThe x-coordinate of the reference line
[in]relativePositionThe 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]attachedWhether the reference line is attached to the image. Attached reference lines moves together with the image.
[in]clrThe color of the reference line, the default value is blue
Return values
refLineIdReturn the ID of the new reference line in the scene.

◆ FitInView()

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.

Parameters
[in]tlxThe x-coordinate of the top-left corner of the rectangle region, aka. left border, in pixel unit.
[in]tlyThe y-coordinate of the top-left corner of the rectangle region, aka. top border, in pixel unit.
[in]wThe width of the rectangle region, in pixel unit.
[in]hThe height of the rectangle region, in pixel unit.
[in]alignFlagsThe alignment, the control's Alignment property is used if it's not set.

◆ FitToWindow()

void FitToWindow ( LPVAlignment  alignFlags)

Zoom and translate the scene, to view the entire scene and fit the window.

Parameters
[in]alignFlagsThe alignment, the control's Alignment property is used if it's not set.

◆ Refresh()

void Refresh ( )

Refresh the scene and redraw the window, request a delayed repaint by the message loop system.

◆ RefreshImmediate()

void RefreshImmediate ( )

Refresh the scene and redraw the window immediately.

◆ RemoveAllReferenceLine()

void RemoveAllReferenceLine ( )

Remove all reference lines from the scene.

◆ RemoveReferenceLine()

void RemoveReferenceLine ( int  refLineId)

Remove the reference line from the scene, by its ID.

Parameters
[in]refLineIdThe reference line's ID.

◆ SaveSceneToFile()

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.).

Parameters
[in]filenameFull path of the file, it could be absolute or relative path with file name and extension.
[in]zoomXFactor for zooming in or out in the x-coordinate direction. By default, it's 1, means the true 100% scale.
[in]zoomYFactor for zooming in or out in the y-coordinate direction. Setting to 0 means same zoom factor as zoomX, aka. isotropic scaling.
Return values
errorReturn error code if anything is wrong. see LPVErrorCode.

◆ SaveWindowToFile()

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.).

Parameters
[in]filenameFull path of the file, it could be absolute or relative path with file name and extension.
Return values
errorReturn error code if anything is wrong. see LPVErrorCode.

◆ SetDisplayFlag()

void SetDisplayFlag ( LPVDisplayFlags  flag,
BOOL  enable 
)

Enable / disable display flags for the control.

Parameters
[in]flagThe display flag to be changed.
[in]enableEnables or disable the display flag.

◆ SetSize()

void SetSize ( int  w,
int  h 
)

Set the size of the scene, in pixel unit.

Parameters
[in]wThe width of the scene.
[in]hThe height of the scene.

◆ ShowDialog()

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.

Parameters
[in]dialogNameThe name of the dialog, shown in title bar.
[in]xThe x-coordinate of the window
[in]yThe y-coordinate of the window
[in]wThe width of the window
[in]hThe height of the window
See also
ShowDialogAsync()

◆ ShowDialogAsync()

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.

Parameters
[in]dialogNameThe name of the dialog, shown in title bar.
[in]xThe x-coordinate of the window
[in]yThe y-coordinate of the window
[in]wThe width of the window
[in]hThe height of the window
[in]refreshIntervalThe interval that the dialog is refreshed in microseconds.
See also
ShowDialog()