Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
LEADCAPTUREAREAOPTION
typedef struct tagLEADCAPTUREAREAOPTION
{
L_UINT uStructSize;
L_UINT uAreaType;
L_INT nFillPattern;
COLORREF crFillForeColor;
COLORREF crFillBackColor;
L_UINT uDrawLineStyle;
COLORREF crDrawLineColor;
L_UINT uEllipseWidth;
L_UINT uEllipseHeight;
L_UINT uFlags;
HCURSOR hDrawCursor;
COLORREF crTextForeColor;
COLORREF crTextBackColor;
L_INT nInfoLeft;
L_INT nInfoTop;
L_INT nInfoWidth;
L_INT nInfoHeight;
} LEADCAPTUREAREAOPTION, * LPLEADCAPTUREAREAOPTION;
This structure is used to define the options of the L_CaptureArea function.
Member |
Description |
|
uStructSize |
Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value. |
|
uAreaType |
Type of area to capture. Possible values for enumeration AREATYPEENUM are: |
|
|
CAPTURE_AREA_TRIANGLE |
Triangle |
|
CAPTURE_AREA_RECT |
Rectangle |
|
CAPTURE_AREA_ROUNDRECT |
Rounded Rectangle |
|
CAPTURE_AREA_ELLIPSE |
Ellipse |
|
CAPTURE_AREA_POLYGON |
Polygon (each click defines point) |
|
CAPTURE_AREA_FREEHAND |
Freehand (click and drag) |
nFillPattern |
Fill pattern for the bitmap. Possible values are: |
|
|
CAPTURE_AREA_PATTERN_HORIZONTAL |
HS_HORIZONTAL /* ----- */ |
|
CAPTURE_AREA_PATTERN_VERTICAL |
HS_VERTICAL /* ||||| */ |
|
CAPTURE_AREA_PATTERN_FDIAGONAL |
HS_FDIAGONAL /* \\\\\ */ |
|
CAPTURE_AREA_PATTERN_BDIAGONAL |
HS_BDIAGONAL /* ///// */ |
|
CAPTURE_AREA_PATTERN_CROSS |
HS_CROSS /* +++++ */ |
|
CAPTURE_AREA_PATTERN_DIAGCROSS |
HS_DIAGCROSS /* xxxxx */ |
|
CAPTURE_AREA_PATTERN_SOLID |
HS_DIAGCROSS+1 /*Solid Fill*/ |
crFillForeColor |
Foreground color. |
|
crFillBackColor |
Background color. |
|
uDrawLineStyle |
Draw line style. Possible values are: |
|
|
CAPTURE_AREA_LINE_SOLID |
PS_SOLID /*________*/ |
|
CAPTURE_AREA_LINE_DASH |
PS_DASH /*----------*/ |
|
CAPTURE_AREA_LINE_DOT |
PS_DOT /*..........*/ |
|
CAPTURE_AREA_LINE_DASHDOT |
PS_DASHDOT /*-.-.-.-.-.*/ |
|
CAPTURE_AREA_LINE_DASHDOTDOT |
PS_DASHDOTDOT /*-..-..-*/ |
crDrawLineColor |
Line color for drawing. |
|
uEllipseWidth |
Width of the ellipse used when drawing a rounded rectangle. |
|
uEllipseHeight |
Height of the ellipse used when drawing a rounded rectangle. |
|
uFlags |
Flags for options. Possible values are: |
|
|
CAPTURE_AREA_SHOW_DRAWCURSOR |
[0x0001] Show cursor during drawing. |
|
CAPTURE_AREA_INCLUDE_CURSOR |
[0x0002] Include cursor in captured image (this is the hCursor from LEADCAPTUREOPTION). |
|
CAPTURE_AREA_ENABLE_KEYBOARD |
[0x0004] Allow Ctrl, Shift,+,- keys during capture. |
|
|
(+/-) Are used for Zooming In/Out in the info window |
|
|
(Ctrl) If Area is Rect, RoundRect, or Ellipse, pressing CTRL will center the drawing. |
|
|
(Shift) If Area is Rect, RoundRect, or Ellipse, pressing SHIFT will draw regular shapes (that is Ellipse becomes a circle , Rectangle becomes a Square, etc.). |
|
CAPTURE_AREA_SHOW_OPAQUE_TEXT |
[0x0008] Text for cursor position and capture size should have an opaque back color. (Used only for the above CAPTURE_AREA_SHOW_CURSORPOS and CAPTURE_AREA_SHOW_CAPTURESIZE. The info window has opaque text). |
|
CAPTURE_AREA_SHOW_CURSORPOS |
[0x0010] Show cursor position during drawing right next to the cursor |
|
CAPTURE_AREA_SHOW_CAPTURESIZE |
[0x0020] Show the width and height of the capture. |
|
CAPTURE_AREA_SHOW_INFOWINDOW |
[0x0040] Display the info window, the current cursor location, the coordinates of the cursor, and the width and height of the area. |
|
CAPTURE_AREA_SENSITIVE_INFOWINDOW |
[0x0080] Enable Sensitive detection for the Info window position. |
|
CAPTURE_AREA_BITMAP_WITH_REGION |
[0x0100] Captured bitmap will contain a region selected by user. This region will be the shape indicated in Area. |
|
CAPTURE_AREA_USE_DEFAULT_VALUES |
[0x0200] Use default capture area options, all the other flags will be ignored if this flag is set. |
|
|
When this flag is set, uAreaType and uSize must be set. |
|
CAPTURE_AREA_ZOOM_NORM |
[0x1000] The image is not zoomed. |
|
CAPTURE_AREA_ZOOM_BY2X |
[0x2000] the image is zoomed 2X. |
|
CAPTURE_AREA_ZOOM_BY3X |
[0x3000] the image is zoomed 3X. |
|
CAPTURE_AREA_ZOOM_BY4X |
[0x4000] the image is zoomed 4X. |
|
CAPTURE_AREA_ZOOM_BY5X |
[0x5000] the image is zoomed 5X. |
|
CAPTURE_AREA_ZOOM_BY6X |
[0x6000] the image is zoomed 6X. |
|
CAPTURE_AREA_ZOOM_BY7X |
[0x7000] the images is zoomed 7X. |
|
CAPTURE_AREA_ZOOM_BY8X |
[0x8000] the image is zoomed 8X. |
|
CAPTURE_AREA_ZOOM_BY9X |
[0x9000] the image is zoomed 9X. |
|
CAPTURE_AREA_ZOOM_BY10X |
[0xA000] the image is zoomed 10X. |
|
CAPTURE_AREA_ZOOM_BY11X |
[0xB000] the image is zoomed 11X. |
|
CAPTURE_AREA_ZOOM_BY12X |
[0xC000] the image is zoomed 12X. |
|
CAPTURE_AREA_ZOOM_BY13X |
[0xD000] the image is zoomed 13X. |
|
CAPTURE_AREA_ZOOM_BY14X |
[0xE000] the image is zoomed 14X. |
|
CAPTURE_AREA_ZOOM_BY15X |
[0xF000] the image is zoomed 15X. |
|
CAPTURE_AREA_ZOOM_MASK |
[0xF000] the image is zoomed by the mask. |
hDrawCursor |
Cursor for drawing area. |
|
crTextForeColor |
Foreground color of info text. |
|
crTextBackColor |
Background color of info text. |
|
nInfoLeft |
Left coordinate of the info window. Possible values are listed below. In addition, any other positive value specified by the user to define left position for the Info Window may be used. |
|
|
CAPTURE_AREA_INFOWND_POS_LEFT |
-1 |
|
CAPTURE_AREA_INFOWND_POS_RIGHT |
-2 |
nInfoTop |
Top coordinate of the info window. Possible values are listed below. In addition, any other positive value specified by the user to define the top position for the Info Window may be used. |
|
|
CAPTURE_AREA_INFOWND_POS_TOP |
-3 |
|
CAPTURE_AREA_INFOWND_POS_BOTTOM |
-4 |
nInfoWidth |
Width of the info window. Possible values are listed below. In addition, any other positive value specified by the user to define custom width and height for the info window may be used. |
|
|
CAPTURE_AREA_INFOWND_SIZE_TINY |
-1 |
|
CAPTURE_AREA_INFOWND_SIZE_SMALL |
-2 |
|
CAPTURE_AREA_INFOWND_SIZE_MEDIUM |
-3 |
|
CAPTURE_AREA_INFOWND_SIZE_LARGE |
-4 |
|
CAPTURE_AREA_INFOWND_SIZE_XLARGE |
-5 |
nInfoHeight |
Height of the info window. Possible values are the same as for nInfoWidth. Both nInfoWidth and nInfoHeight must be positive values or values from the table in nInfoWidth. |
Comments
The area of the bitmap outside the user-defined region will be filled with the pattern defined by nFillPattern, crFillForeColor, and crFillBackColor.
The zoom factor can be obtained from the flags as follows:
zoom_factor = ((uFlags & CAPTURE_AREA_ZOOM_MASK) >> 12)
The flag can be obtained from the zoom factor as follows
Flag = (zoom_factor)<< 12
nInfoWidth, nInfoTop, nInfoWidth and nInfoHeight are ignored if CAPTURE_AREA_SHOW_INFOWINDOW is not set.
CAPTURE_AREA_SHOW_INFOWINDOW and CAPTURE_AREA_SHOW_CAPTURESIZE are not mutually exclusive. If both flags are set, you will have both an info window and the size of the captured area. Likewise, if CAPTURE_AREA_SHOW_INFOWINDOW and CAPTURE_AREA_SHOW_CURSORPOS are set, you will have both an info window and the position of the cursor.
After the initial placement of the info window, the window will be moved to another corner of the screen whenever the mouse cursor becomes near the info window. This way, the user will not be disturbed during the selection of the area he wants, and he will be able to see a zoomed image for the current cursor position. The info window will look like this: