L_PointillistBitmap

#include "l_bitmap.h"

L_LTIMGSFX_API L_INT L_PointillistBitmap(pBitmap, uSize, crColor, uFlags)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

L_UINT uSize;

/* dot size */

COLORREF crColor;

/* background color */

L_UINT uFlags;

/* flags */

Converts image colors into randomly placed dots to create a pointillist painting, and uses the background color to fill the area between dots.

Parameter

Description

pBitmap

Pointer to the bitmap handle referencing the bitmap to be changed.

uSize

Dot size, in pixels.

crColor

Fill color.

uFlags

Flags that indicate which background and dot type to use. You can use a bit wise OR (|) to specify one flag from each group.

The following flags indicate which background to use:

 

Value

Meaning

 

POINTILLIST_IMAGE

[0x0001] Use the image as the background.

 

POINTILLIST_COLOR

[0x0002] Fill the background with crColor.

 

The following flags indicate which dot type to use:

 

Value

Meaning

 

POINTILLIST_STICKER

[0x0010] Use Dots that will overlap like stickers.

 

POINTILLIST_POINT

[0x0020] Use Dots that will adjust like bubbles.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

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.

Pointillism is a painting technique where the image is composed of tiny, separate dots of primary color. Non primary colors are created by placing primary colors beside each other and allowing the "mixing" to be performed when the image is viewed.

For an example, click here

Use the L_RomanMosaicBitmap function to divide the bitmap into rectangular or arc-shaped cells and then fill each cell with a color chosen randomly from the colors of each tiles pixels.

Use the L_MosaicBitmap function to impose a mosaic effect on a bitmap by dividing the bitmap into tiles of a specified size and changing the color of all pixels in each tile to the average color of pixels within the tile.

Use the L_PixelateBitmap function to divide the bitmap into rectangular or arc-shaped cells and then recreate the image by filling those cells with the minimum, maximum, or average pixel value, depending upon the effect that was selected.

Use the L_MosaicTilesBitmap function to make an image look like a mosaic made from tiles. Tiles can be rectangular or arc-shaped, depending upon the coordinate system used to draw the tiles.

To update a status bar or detect a user interrupt during execution of this function, refer to L_SetStatusCallback.

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 in the Document and Medical Imaging 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 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.

Required DLLs and Libraries

LTIMGSFX

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 2000 / XP/Vista.

See Also

Functions:

L_DefaultDithering, L_GrayScaleBitmap, L_GrayScaleBitmapExt, L_AutoColorLevelBitmap, L_ColorLevelBitmap, L_CorrelationBitmap, L_GrayScaleToDuotone, L_GrayScaleToMultitone, L_HolesRemovalBitmapRgn, L_SelectiveColorBitmap, L_SkeletonBitmap, L_HalfToneBitmap, L_MosaicBitmap, L_PixelateBitmap, L_MosaicTilesBitmap, L_RomanMosaicBitmap, L_CubismBitmap, L_DiceEffectBitmap, L_GlassEffectBitmap, L_PuzzleEffectBitmap, L_RingEffectBitmap, L_CanvasBitmap, L_BricksTextureBitmap

Topics:

Raster Image Functions: Doing Color Expansion or Reduction

 

Raster Image Functions: Artistic Effects

 

Applying Artistic Effects

 

Raster Image Functions: Filtering Images

Example

 L_INT PointillistBitmapExample(L_VOID)
{
   L_INT nRet;
   BITMAPHANDLE LeadBitmap;

   /* Load the bitmap, keeping the bits per pixel of the file */
   nRet = L_LoadBitmap(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\Sample1.CMP"), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL);
   if(nRet !=SUCCESS)
      return nRet;
   /*Apply the filter*/
   nRet = L_PointillistBitmap(&LeadBitmap, 25, RGB(255,255,255), POINTILLIST_COLOR | POINTILLIST_POINT);
   if(nRet !=SUCCESS)
      return nRet;
   nRet = L_SaveBitmap(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\Result.BMP"), &LeadBitmap, FILE_BMP, 24, 0, NULL);
   if(nRet !=SUCCESS)
      return nRet;
   //free bitmap 
   if(LeadBitmap.Flags.Allocated)  
      L_FreeBitmap(&LeadBitmap);  
   return SUCCESS;
}