Adds colored balls to the bitmap. Various parameters control the color and appearance of the balls.
#include "ltwrappr.h"
L_INT LBitmap::ColoredBalls(uNumBalls, uSize, uSizeVariation, nHighLightAng, crHighLight, crBkgColor, crShadingColor, pBallColors, uNumOfBallColors, uAvrBallClrOpacity, uBallClrOpacityVariation, uRipple, uFlags)
Number of balls that will be drawn in the image.
Average ball size, in pixels.
Ball size variation. Valid values range from 0 to 100. Use 0 to have all balls the same size. Use 100 to have the size vary from 0 to 2 X uSize.
Light source direction of the highlight color on the ball. This value is in hundredths of degrees (+/-). A positive value will rotate the highlight color clockwise, while a negative value will rotate the highlight color counter-clockwise. Possible values range from -36000 to + 36000.
Highlight color.
Background color.
Shade (or gradient) color.
Pointer to an array of ball colors.
The number of ball colors.
Average ball color opacity. Valid values ranges are:
Ball color opacity variation. Valid values range from 0 to 100. Use 0 to have all pixels assigned the same opacity. Use 100 to have the opacity vary from 0 to 2 X uAvrBallClrOpacity.
The number of shades that are used to produce the background. This value is divided internally by 100. For example, if uRipple = 200 the actual frequency is 2. This value is ignored if the CLRBALLS_SHADING_SINGLE flag is set.
Flags that indicate which background color, shade (or gradient) type, ball type and ball color type to use. You can use a bit wise OR ( | ) to specify one flag from each group.
Value | Meaning |
---|---|
CLRBALLS_SHADING_SINGLE | [0x0001] Use only the background color (i.e. no shading). |
CLRBALLS_SHADING_LEFTRIGHT | [0x0002] Draw shading as vertical lines that move from left to right. |
CLRBALLS_SHADING_TOPBOTTOM | [0x0003] Draw shading as horizontal lines that move from top to bottom. |
CLRBALLS_SHADING_CIRCULAR | [0x0004] Draw shading as concentric circles. |
CLRBALLS_SHADING_ELLIPTICAL | [0x0005] Draw shading as concentric ellipses. |
Value | Meaning |
---|---|
CLRBALLS_STICKER | [0x0010] Use Balls that will overlap like stickers. |
CLRBALLS_BALL | [0x0020] Use Balls that will adjust like bubbles. |
Value | Meaning |
---|---|
CLRBALLS_IMAGE | [0x0100] Make the background the same as the image. |
CLRBALLS_COLOR | [0x0200] Make the background using crBkgColor and crShadingColor with the specified shade type. |
Value | Meaning |
---|---|
CLRBALLS_BALLCLR_MASK | [0x1000] Have the Ball color block image colors. |
CLRBALLS_BALLCLR_OPACITY | [0x2000] Use the opacity value when combining image colors with ball colors. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The CLRBALLS_STICKER flag produces balls with more distinct edges than the CLRBALLS_BALL option.
To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.
This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
If the bitmap has a region, this function works only on the region. If the bitmap does not have a region, this function works on the entire bitmap.
This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.
This function does not support 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.
Colored Balls Function - Before
Colored Balls Function - After
View additional platform support for this Colored Balls function.
Win32, x64.
L_INT LBitmap__ColoredBallsExample()
{
L_INT nRet;
COLORREF pBallColors[7];
pBallColors[0] = RGB(230,50,50);
pBallColors[1] = RGB(230,200,160);
pBallColors[2] = RGB(255,255,128);
pBallColors[3] = RGB(240,50,100);
pBallColors[4] = RGB(255,255,180);
pBallColors[5] = RGB(170,240,100);
pBallColors[6] = RGB(255,255,255);
LBitmap LeadBitmap;
nRet =LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("cannon.jpg")), 0,ORDER_BGR);
if(nRet !=SUCCESS)
return nRet;
nRet =LeadBitmap.ColoredBalls(1000, 25, 15, 4500, RGB(255,255,255), RGB(255,0,0),
RGB(255,255,0), pBallColors, 7, 64, 10, 100,
CLRBALLS_SHADING_CIRCULAR|
CLRBALLS_STICKER|CLRBALLS_IMAGE|
CLRBALLS_BALLCLR_OPACITY);
if(nRet !=SUCCESS)
return nRet;
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document