This interface provide miscellaneous functions to change LPV system configurations globally. More...
Public Member Functions | |
BOOL | CheckLib (LString libName) |
BOOL | CheckLicense () |
BOOL | CheckVersion (long majorVersion, long minorVersion, long microVersion) |
void | DrawCircle (double x, double y, double r, BOOL bFill, HDC hdc, double zoomX, double zoomY, double panX, double panY) |
void | DrawLine (double x1, double y1, double x2, double y2, HDC hdc, double zoomX, double zoomY, double panX, double panY) |
void | DrawPoint (double x, double y, LPVPointShape shape, HDC hdc, double zoomX, double zoomY, double panX, double panY) |
void | DrawPolygon (LArray< double > xs, LArray< double > ys, BOOL bClosed, BOOL bFill, HDC hdc, double zoomX, double zoomY, double panX, double panY) |
void | DrawRect (double x, double y, double w, double h, double a, BOOL bFill, HDC hdc, double zoomX, double zoomY, double panX, double panY) |
void | DrawString (LString text, int tlx, int tly, HDC hdc, double zoomX, double zoomY, double panX, double panY) |
COLORREF | GetColorRef (int red, int green, int blue) |
void | GetRGBFromColorRef (COLORREF colorRef, int *red, int *green, int *blue) |
LPVErrorCode | RefreshDefaults (LString filename) |
void | SetDefault (LString settingName, LString val) |
void | SetDrawPointSize (int size) |
void | SetRegionHandleSize (int size) |
This interface provide miscellaneous functions to change LPV system configurations globally.
To use this interface, you should create a LSystem object.
BOOL CheckLib | ( | LString | libName | ) |
Check whether the library is licensed then you can use the algorithms in that library.
You may call it as:
[in] | libName | Pass in the name of the library. The name is case-insensitive, and the "lpv" prefix can be omitted, say "lpvCore.dll", "lpvCore", "core", "CORE". |
val | True for valid license, otherwise, return False. |
BOOL CheckLicense | ( | ) |
Check any valid license is available. Note: we won't exam the feature IDs here, you should call CheckLib() instead.
You may call it as:
val | True for valid license, otherwise, return False. |
BOOL CheckVersion | ( | long | majorVersion, |
long | minorVersion, | ||
long | microVersion | ||
) |
Check the compatibility of the running and the compiled version of the LPW toolkit. You may call it as:
For failed check, you may re-install the correct version. It's recommended to use the same version for compiling and running.
[in] | majorVersion | The major version in compiling. |
[in] | minorVersion | The minor version in compiling. |
[in] | microVersion | The micro version in compiling. |
val | True for valid compatibility, otherwise, return False. |
void DrawCircle | ( | double | x, |
double | y, | ||
double | r, | ||
BOOL | bFill, | ||
HDC | hdc, | ||
double | zoomX, | ||
double | zoomY, | ||
double | panX, | ||
double | panY | ||
) |
Draw a circle on HDC. Current pen and brush of the system object is used.
[in] | x | The x-coordinate of the input circle's center point. |
[in] | y | The y-coordinate of the input circle's center point. |
[in] | r | The radius of the input circle. |
[in] | bFill | Whether to fill the circle using current brush. |
void DrawLine | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2, | ||
HDC | hdc, | ||
double | zoomX, | ||
double | zoomY, | ||
double | panX, | ||
double | panY | ||
) |
Draw a line on HDC. Current pen of the system object is used.
[in] | x1 | The x-coordinate of the input line's start point. |
[in] | y1 | The y-coordinate of the input line's start point. |
[in] | x2 | The x-coordinate of the input line's end point. |
[in] | y2 | The y-coordinate of the input line's end point. |
void DrawPoint | ( | double | x, |
double | y, | ||
LPVPointShape | shape, | ||
HDC | hdc, | ||
double | zoomX, | ||
double | zoomY, | ||
double | panX, | ||
double | panY | ||
) |
Draw a point on HDC. Current pen of the system object is used.
[in] | x | The x-coordinate of the input point. |
[in] | y | The y-coordinate of the input point. |
[in] | shape | The drawn shape of the point. |
void DrawPolygon | ( | LArray< double > | xs, |
LArray< double > | ys, | ||
BOOL | bClosed, | ||
BOOL | bFill, | ||
HDC | hdc, | ||
double | zoomX, | ||
double | zoomY, | ||
double | panX, | ||
double | panY | ||
) |
Draw a polygon on HDC.
[in] | xs | The x-coordinates of the input polygon vertexes. |
[in] | ys | The y-coordinates of the input polygon vertexes. |
[in] | bClosed | Whether this is a closed polygon. |
[in] | bFill | Whether to fill the circle using current brush. |
void DrawRect | ( | double | x, |
double | y, | ||
double | w, | ||
double | h, | ||
double | a, | ||
BOOL | bFill, | ||
HDC | hdc, | ||
double | zoomX, | ||
double | zoomY, | ||
double | panX, | ||
double | panY | ||
) |
Draw a rectangle on HDC.
[in] | x | The x-coordinate of the input rectangle's center point. |
[in] | y | The y-coordinate of the input rectangle's center point. |
[in] | w | The width of the input rectangle. |
[in] | h | The height of the input rectangle. |
[in] | a | The angle of the input rectangle. |
[in] | bFill | Whether to fill the circle using current brush. |
void DrawString | ( | LString | text, |
int | tlx, | ||
int | tly, | ||
HDC | hdc, | ||
double | zoomX, | ||
double | zoomY, | ||
double | panX, | ||
double | panY | ||
) |
Draw a text string on HDC.
[in] | text | The input text string. |
[in] | tlx | The x-coordinate of the top-left corner of the text region. |
[in] | tly | The y-coordinate of the top-left corner of the text region. |
COLORREF GetColorRef | ( | int | red, |
int | green, | ||
int | blue | ||
) |
Convert RGB(red, green, blue) value to a 32-bit value representing the same color, in RRGGBB format. Alternatively, you could use ColorTranslator.ToWin32() for C# or RGB() macro in GDI for C++.
void GetRGBFromColorRef | ( | COLORREF | colorRef, |
int * | red, | ||
int * | green, | ||
int * | blue | ||
) |
Get RGB(red, green, blue) values from a 32-bit value representing the same color. The 32-bit value is in RRGGBB format. Alternatively, you could use ColorTranslator.FromWin32() for C# or GetRValue()/GetGValue()/GetBValue() macro in GDI for C++.
[in] | colorRef | The input color value |
[out] | red | Output the red value |
[out] | green | Output the green value |
[out] | blue | Output the blue value |
LPVErrorCode RefreshDefaults | ( | LString | filename | ) |
Refresh system default settings from the given .default file, which is a yml file as following:
[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. |
Change system default setting. The supported settings are listed in the following table:
Setting | Usage | Default Value |
---|---|---|
pointSize | Radius of point drawn on canvas (pixel) | 5 |
roiHandleSize | Region handles' size on canvas (pixel) | 7 |
paragraphSpace | Paragraph space for text drawn on canvas (pixel) | 6 |
doublePrecision | Double precision used in drawing a chart on canvas (pixel) | 3 |
defaultLogLevel | Log level (0 Trace, 10000 Debug, 20000 Info, 30000 Warn, 40000 Error, 50000 Fatal, 60000 Off) | 30000 (Warn) |
noLicenseRetryMsgBox | Whether to stop showing up the licensing failure dialog for user to retry | false (pop up) |
silent | Whether to stop showing up any message box | false (pop up) |
genCrashDump | Whether to generate the core dump file when crash | false (no) |
useFullDump | Whether to generate the full core dump file | false (no) |
You may call it as:
[in] | settingName | The default setting name. |
[in] | val | The new setting value. |
void SetDrawPointSize | ( | int | size | ) |
Change the radius of point drawn on canvas globally, by default it's 5 pixels.
void SetRegionHandleSize | ( | int | size | ) |
Change the size of region handles(and its interactable area) drawn on canvas globally, by default it's 7 pixels.
[in] | size | The required handle size in pixel. |