Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
typedef struct _ADDBORDERINFO
{
L_UINT uStructSize;
L_INT nLeftThickness;
L_INT nTopThickness;
L_INT nRightThickness;
L_INT nBottomThickness;
L_INT nLocation;
L_INT nStyle;
L_INT nEffectStyle;
pBITMAPHANDLE pTileBitmap;
L_INT nGradientStyle;
COLORREF crGradientStart;
COLORREF crGradientEnd;
L_INT nCurveIntensity;
L_BOOL bSoftCurve;
L_BOOL bShadow;
L_INT nShadowSize;
L_INT nShadowDirection;
L_BOOL bBumpyShadow;
} ADDBORDERINFO, * pADDBORDERINFO;
The ADDBORDERINFO structure contains information about the border to add to the bitmap.
Member |
Description |
|
uStructSize |
Size of this structure in bytes. Use the sizeof() macro to calculate this value. |
|
nLeftThickness |
The thickness of the left side of the border. |
|
nTopThickness |
The thickness of the top side of the border. |
|
nRightThickness |
The thickness of the right side of the border. |
|
nBottomThickness |
The thickness of the bottom side of the border. |
|
nLocation |
Flag that indicates the position of the border. Possible values are: |
|
|
Value |
Meaning |
|
BORDER_INSIDE |
[0] The border will be within the bitmap. This is the default. |
|
BORDER_OUTSIDE |
[1] The border will be outside the bitmap. |
nStyle |
Flag that indicates the style of the border. Possible values are: |
|
|
Value |
Meaning |
|
BORDER_STYLE_TRANSPARENT |
[0] The border is transparent. Therefore, the bitmap itself shows through as the border. This is the default. |
|
BORDER_STYLE_OPAQUE |
[1] Use a single color to create the border. The color used is crGradientStart. |
|
BORDER_STYLE_GRADIENT |
[2] The border contains a color gradient from crGradientStart to crGradientEnd. |
|
BORDER_STYLE_TILES |
[3] The border is taken from the bitmap referenced by the pTileBitmap member. |
nEffectStyle |
Flag that indicates the change in the appearance of the border. By default there are no changes. The change also depends on the value of nCurveIntesity. If nCurveIntensity is zero, there are no changes. Possible values are: |
|
|
Value |
Meaning |
|
BORDER_EFFECT_CURVEDIN |
[1] Add a 3D appearance to the border by adding a high intensity color to the inner side of the border and a lower intensity color to the outer side of the border. |
|
BORDER_EFFECT_CURVEDOUT |
[2] Add a 3D appearance to the border by adding a high intensity color to the outer side of the border and a lower intensity color to the inner side of the border. |
|
BORDER_EFFECT_RAISED |
[3] Add a curved appearance to the border. |
pTileBitmap |
Pointer to a bitmap handle that references the tile bitmap. This is the bitmap the border is taken from when nStyle is BORDER_STYLE_TILES. |
|
nGradientStyle |
Flag that indicates the gradient style. This flag is used only when the nStyle member is BORDER_STYLE_GRADIENT. Possible values are: |
|
|
Value |
Meaning |
|
BORDER_GRAD_INSIDEOUT |
[0] The gradient starts from the inside of the border and progresses toward the outside of the border. This is the default. |
|
BORDER_GRAD_CENTEROUT |
[1] The gradient starts from the center of the border and progresses toward both the inside and outside of the border. |
|
BORDER_GRAD_CORNEROUT |
[2] The gradient starts from the corners of the border. |
crGradientStart |
COLORREF value that specified the starting color when nStyle is BORDER_STYLE_GRADIENT. This is also the color used when nStyle is BORDER_STYLE_OPAQUE. |
|
crGradientEnd |
COLORREF value that specified the ending color when nStyle is BORDER_STYLE_GRADIENT. |
|
nCurveIntensity |
Value that indicates the degree to which to change the appearance of the border. This value is used only when the nEffectStyle flag is set. The range is from –1000 to 1000. |
|
bSoftCurve |
Boolean flag that indicates whether to give the border a soft curve appearance. This flag is used only when nEffectStyle is BORDER_EFFECT_RAISED. Possible values are: |
|
|
Value |
Meaning |
|
TRUE |
Make the border more homogeneous in intensity, giving the appearance of a smoother curve. |
|
FALSE |
Do not make the border more homogeneous in intensity. |
bShadow |
Boolean flag that indicates whether to add a shadow to the border. Possible values are: |
|
|
Value |
Meaning |
|
TRUE |
Add a shadow to the border. |
|
FALSE |
Do not add a shadow to the border. This is the default. |
nShadowSize |
Value that indicates the width of the shadow, in pixels. This value is used only when bShadow is TRUE. |
|
nShadowDirection |
Flag that indicates the direction of the shadow. This value is used only when bShadow is TRUE. Possible values are: |
|
|
Value |
Meaning |
|
BORDER_SHADOW_LEFT |
[0] The shadow is on the left top side of the image. This is the default. |
|
BORDER_SHADOW_RIGHT |
[1] The shadow is on the right bottom side of the image. |
|
BORDER_SHADOW_SURROUND |
[2] The shadow surrounds the border. |
bBumpyShadow |
Boolean flag that indicates whether to increase the intensity near the far edge of the shadow. This flag is used only when bShadow is TRUE. Setting this flag to TRUE produces a good appearance for the shadow if nShadowSize is a value between 4 and 7. Possible values are: |
|
|
Value |
Meaning |
|
TRUE |
Increase the intensity near the far edge of the shadow. |
|
FALSE |
Do not increase the intensity near the far edge of the shadow. |
Comments
This structure is used by the LBitmap::AddBorder function.
LPADDBORDERINFO is a pointer to a ADDBORDERINFO structure. Where a function parameter type is LPADDBORDERINFO, declare an ADDBORDERINFO variable and pass the variable's address in the parameter. Declaring an LPADDBORDERINFO variable is necessary only if the program requires a pointer.
Some functions which take this structure as a parameter require that the structure be initialized prior to the function call. You must set the uStructSize member to the total size, in bytes, of the structure. Use the sizeof() macro to calculate this value. Functions that do not require the structure be initialized will take the total size of the structure, in bytes, as an additional function parameter.
The images below demonstrate some of the borders that are possible, by setting various members and flags.
nStyle = BORDER_STYLE_OPAQUE
nStyle = BORDER_STYLE_OPAQUE
nEffectStyle = BORDER_EFFECT_CURVEDIN
nCurveIntesity = 200
nStyle = BORDER_STYLE_OPAQUE
nEffectStyle = BORDER_EFFECT_CURVEDOUT
nCurveIntesity = 200
nStyle = BORDER_STYLE_OPAQUE
nEffectStyle = BORDER_EFFECT_RAISED
nCurveIntesity = 100
nStyle = BORDER_STYLE_OPAQUE
nEffectStyle = BORDER_EFFECT_RAISED
nCurveIntesity = 100
bSoftCurve = TRUE
nStyle = BORDER_STYLE_GRADIENT
nGradientStyle = BORDER_GRAD_INSIDEOUT
crGradientStart = RGB(255, 0, 0)
crGradientEnd = RGB(0, 0, 255)
nStyle = BORDER_STYLE_GRADIENT
nGradientStyle = BORDER_GRAD_CENTEROUT
crGradientStart = RGB(255, 0, 0)
crGradientEnd = RGB(0, 0, 255)
nStyle = BORDER_STYLE_GRADIENT
nGradientStyle = BORDER_GRAD_CORNEROUT
crGradientStart = RGB(255, 0, 0)
crGradientEnd = RGB(0, 0, 255)
nBorderLocation = BORDER_OUTSIDE
nStyle = BORDER_STYLE_OPAQUE
bShadow = TRUE
nShadowSize = 5
bBumpyShadow = TRUE
nShadowDirection = BORDER_SHADOW_SURROUND