Leadtools.ImageProcessing.SpecialEffects Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
MosaicTilesCommand Constructor(Int32,Int32,Int32,Int32,ShadowCommandAngle,Int32,RasterColor,RasterColor,MosaicTilesCommandFlags)
See Also  Example
Leadtools.ImageProcessing.SpecialEffects Namespace > MosaicTilesCommand Class > MosaicTilesCommand Constructor : MosaicTilesCommand Constructor(Int32,Int32,Int32,Int32,ShadowCommandAngle,Int32,RasterColor,RasterColor,MosaicTilesCommandFlags)



opacity
Value that represents the weight, in percent, given to the image color and the border or tile color when determining the resulting color. For example, if the Opacity property is set to 75, then 75 of the image color will be added to 75 of the border (or Tile) color. Final results are clipped if greater than 255. Possible values range from 0 to 100.
penWidth
Value that indicates the width of the pen used to draw tile boundaries, in logical units. Possible values range from 1 to 15. The pen uses the crBorderColor.
tileWidth
Value that represents the width of the tile. The meaning of the value in the TileWidth property differs according to the flags that are set in the Flags property. Possible values are:
If Flags property contains: Then, TileWidth property contains: And the range of possible values for TileWidth property is:
MosaicTilesCommandFlags.Cartesian The width of each rectangular tile, in pixels. 1 to the image width, if there is no region. If there is a region, then the range of values is from 1 to the region width.
MosaicTilesCommandFlags.Polar The size, in degrees, of the curve in the arc-shaped tiles. That is, the circle around the Origin is divided into tiles of TileWidth degrees. 1 to 360. The circle can be divided into tiles from 1 degree to 360 degrees.
tileHeight
Value that represents the height of the tile. The meaning of the value in the TileHeight property differs according to the flags that are set in the Flags proerty. Possible values are:
If Flags property contains: Then, TileHeight property contains: And the range of possible values for TileHeight property is:
MosaicTilesCommandFlags.Cartesian The height of each rectangular tile, in pixels. 1 to the image height, if there is no region. If there is a region, then the range of values is from 1 to the region height.
MosaicTilesCommandFlags.Polar The radial length of each arc-shaped tile, in pixels. 1 to the diagonal of the image, if there is no region. If there is a region, then the range of values is from 1 to the diagonal of the region rectangle.
shadowAngle
Value indicating the direction of the light source that produces the shadow. This property is used if the MosaicTilesCommandFlags.ShadowRGB flag or the MosaicTilesCommandFlags.ShadowGray flag is set. Valid values are found in ShadowCommandAngle
shadowThreshold
Value that determines which pixels will be affected by the shadow. Possible values range from 0 through 255. Pixel values less than the threshold value will be unaffected. This member will be used if the MosaicTilesCommandFlags.ShadowRGB flag or the MosaicTilesCommandFlags.ShadowGray flag is set.
borderColor
Value that specifies the transparency fill color for the tile border areas.
tilesColor
Value that specifies the transparency fill color for the tiles.
flags
that indicate whether to use arc-shaped or rectangular-shaped tiles, and what type of shadowing to use, if any.
Initializes a new MosaicTilesCommand with explicit parameters.

Syntax

Visual Basic (Declaration)  
Public Function New( _
   ByVal opacity As Integer, _
   ByVal penWidth As Integer, _
   ByVal tileWidth As Integer, _
   ByVal tileHeight As Integer, _
   ByVal shadowAngle As ShadowCommandAngle, _
   ByVal shadowThreshold As Integer, _
   ByVal borderColor As RasterColor, _
   ByVal tilesColor As RasterColor, _
   ByVal flags As MosaicTilesCommandFlags _
)
Visual Basic (Usage) Copy Code
Dim opacity As Integer
Dim penWidth As Integer
Dim tileWidth As Integer
Dim tileHeight As Integer
Dim shadowAngle As ShadowCommandAngle
Dim shadowThreshold As Integer
Dim borderColor As RasterColor
Dim tilesColor As RasterColor
Dim flags As MosaicTilesCommandFlags
 
Dim instance As MosaicTilesCommand(opacity, penWidth, tileWidth, tileHeight, shadowAngle, shadowThreshold, borderColor, tilesColor, flags)
C#  
public MosaicTilesCommand( 
   int opacity,
   int penWidth,
   int tileWidth,
   int tileHeight,
   ShadowCommandAngle shadowAngle,
   int shadowThreshold,
   RasterColor borderColor,
   RasterColor tilesColor,
   MosaicTilesCommandFlags flags
)
C++/CLI  
public:
MosaicTilesCommand( 
   int opacity,
   int penWidth,
   int tileWidth,
   int tileHeight,
   ShadowCommandAngle shadowAngle,
   int shadowThreshold,
   RasterColor borderColor,
   RasterColor tilesColor,
   MosaicTilesCommandFlags flags
)

Parameters

opacity
Value that represents the weight, in percent, given to the image color and the border or tile color when determining the resulting color. For example, if the Opacity property is set to 75, then 75 of the image color will be added to 75 of the border (or Tile) color. Final results are clipped if greater than 255. Possible values range from 0 to 100.
penWidth
Value that indicates the width of the pen used to draw tile boundaries, in logical units. Possible values range from 1 to 15. The pen uses the crBorderColor.
tileWidth
Value that represents the width of the tile. The meaning of the value in the TileWidth property differs according to the flags that are set in the Flags property. Possible values are:
If Flags property contains: Then, TileWidth property contains: And the range of possible values for TileWidth property is:
MosaicTilesCommandFlags.Cartesian The width of each rectangular tile, in pixels. 1 to the image width, if there is no region. If there is a region, then the range of values is from 1 to the region width.
MosaicTilesCommandFlags.Polar The size, in degrees, of the curve in the arc-shaped tiles. That is, the circle around the Origin is divided into tiles of TileWidth degrees. 1 to 360. The circle can be divided into tiles from 1 degree to 360 degrees.
tileHeight
Value that represents the height of the tile. The meaning of the value in the TileHeight property differs according to the flags that are set in the Flags proerty. Possible values are:
If Flags property contains: Then, TileHeight property contains: And the range of possible values for TileHeight property is:
MosaicTilesCommandFlags.Cartesian The height of each rectangular tile, in pixels. 1 to the image height, if there is no region. If there is a region, then the range of values is from 1 to the region height.
MosaicTilesCommandFlags.Polar The radial length of each arc-shaped tile, in pixels. 1 to the diagonal of the image, if there is no region. If there is a region, then the range of values is from 1 to the diagonal of the region rectangle.
shadowAngle
Value indicating the direction of the light source that produces the shadow. This property is used if the MosaicTilesCommandFlags.ShadowRGB flag or the MosaicTilesCommandFlags.ShadowGray flag is set. Valid values are found in ShadowCommandAngle
shadowThreshold
Value that determines which pixels will be affected by the shadow. Possible values range from 0 through 255. Pixel values less than the threshold value will be unaffected. This member will be used if the MosaicTilesCommandFlags.ShadowRGB flag or the MosaicTilesCommandFlags.ShadowGray flag is set.
borderColor
Value that specifies the transparency fill color for the tile border areas.
tilesColor
Value that specifies the transparency fill color for the tiles.
flags
that indicate whether to use arc-shaped or rectangular-shaped tiles, and what type of shadowing to use, if any.

Example

Run the MosaicTilesCommand on an image.

Visual Basic Copy Code
Public Sub MosaicTilesConstructorExample_S1()
   RasterCodecs.Startup()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")

   ' Prepare the command
   Dim command As MosaicTilesCommand = New MosaicTilesCommand(50, 7, 50, 50, ShadowCommandAngle.East, 50, New RasterColor(0, 0, 0), New RasterColor(255, 255, 255), MosaicTilesCommandFlags.Cartesian Or MosaicTilesCommandFlags.ShadowGray)
   command.Run(leadImage)
   codecs.Save(leadImage, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24)

   RasterCodecs.Shutdown()
End Sub
C# Copy Code
public void MosaicTilesConstructorExample_S1() 

   // Load an image 
   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg"); 
 
   // Prepare the command 
   MosaicTilesCommand command = new MosaicTilesCommand(50, 7, 50, 50, ShadowCommandAngle.East, 50, new RasterColor(0,0,0), new RasterColor(255,255,255), MosaicTilesCommandFlags.Cartesian | MosaicTilesCommandFlags.ShadowGray); 
   command.Run(image); 
   codecs.Save(image, LeadtoolsExamples.Common.ImagesPath.Path + "Result.jpg", RasterImageFormat.Jpeg, 24); 
 
   RasterCodecs.Shutdown(); 
}

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also