MosaicTiles method (ILEADRasterProcess)
HRESULT MosaicTiles(ILEADRaster * pRaster, long lOpacity, long lPenWidth, long lTileWidth, long lTileHeight, long lCenterX, long lCenterY, long lFlags, ShadowDirectionConstants ShadowAngle, long lShadowThreshold, OLE_COLOR crBorderColor, OLE_COLOR crTilesColor); | |
Overview |
Refer to Applying Artistic Effects. |
Remarks
(Raster Pro and above only) Creates a mosaic effect on an image by dividing an image into rectangular or arc-shaped cells with irregular boundaries and modifying the color of each cell.
This method makes 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. The method's many parameters control factors like the border color, tile color, pen width, tile width and height, etc.
As an example, if you start with the following image:
And you were to call the MosaicTiles method using the following settings:
Parameter |
Value |
lOpacity |
60 |
lPenWidth |
4 |
lTileWidth |
17 |
lTileHeight |
17 |
lCenterX |
na |
lCenterY |
na |
ShadowAngle |
na |
lShadowThreshold |
na |
crBorderColor |
Black |
crTilesColor |
na |
lFlags |
MSCT_CART | MSCT_FLAT |
The following figure results:
Use the Mosaic method to impose a mosaic effect on a bitmap by dividing the bitmap into square blocks of a specified size and changing the color of all pixels in each block to the average color of pixels within the block.
Use the Pixelate method 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 RomanMosaic method to divide the bitmap into rectangular or arc-shaped cells and then fill them with a color chosen randomly from the colors of the tile’s pixels.
Use the Pointillist method to convert image colors into randomly placed dots to create a pointillist painting, using a background color to fill the area between dots.
This method can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.
Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
This method 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 method.
See Also