Leadtools.ImageProcessing.SpecialEffects Namespace > PixelateCommand Class > PixelateCommand Constructor : PixelateCommand Constructor(Int32,Int32,Int32,LeadPoint,PixelateCommandFlags) |
If these flags are set: | Then, the CellWidth property (or the cellWidth parameter) contains: | And the range of possible values is: |
PixelateCommandFlags.Radial | PixelateCommandFlags.WidthFrequency |
the number of cells around the center point. That is, the circle around the center point is divided into equal parts, based on the value in the CellWidth property (or the cellWidth parameter if you are using the Constructor) as shown below: |
1 to 360. The circle can be divided into anywhere from 1 to 360 equal parts. |
PixelateCommandFlags.Radial | PixelateCommandFlags.WidthPeriod |
the size, in degrees of the cells around the center point That is, the circle around the center point is divided into cells based on the number of degrees set in the CellWidth property (or the cellWidth parameter if you are using the Constructor), as shown below: |
1 to 360. The circle can be divided into cells of 1 degree to 360 degrees. |
PixelateCommandFlags.Rectangle | PixelateCommandFlags.WidthFrequency |
the number of cells present across the width of the image. | 1 to the image width, if there is no region. If there is a region, then the range of values is just the region width. |
PixelateCommandFlags.Rectangle | PixelateCommandFlags.WidthPeriod | |
the width of each rectangular cell, in pixels. | 1 to the image width, if there is no region. If there is a region, then the range of values is just the region width. |
If the following flag is set: | Then, the CellHeight property (or the cellHeight parameter if you are using the Constructor) contains: | And the range of possible values is: |
PixelateCommandFlags.Radial | PixelateCommandFlags.HeightFrequency |
the number of cells present along the radius of the circular cell. | 1 to the diagonal of the image, if there is no region. If there is a region, then the range of values is just the diagonal of the region rectangle. |
PixelateCommandFlags.Radial | PixelateCommandFlags.HeightPeriod |
the radial length of each circular cell, 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 just the diagonal of the region rectangle. |
PixelateCommandFlags.Rectangle | PixelateCommandFlags.HeightFrequency |
the number of cells present across the height of the image. | 1 to the image height, if there is no region. If there is a region, then the range of values is just the region height. |
PixelateCommandFlags.Rectangle | PixelateCommandFlags.HeightPeriod | |
the height of each rectangular cell, in pixels. | 1 to the image height, if there is no region. If there is a region, then the range of values is just the region height. |
public PixelateCommand( int cellWidth, int cellHeight, int opacity, LeadPoint centerPoint, PixelateCommandFlags flags )
'Declaration Public Function New( _ ByVal cellWidth As Integer, _ ByVal cellHeight As Integer, _ ByVal opacity As Integer, _ ByVal centerPoint As LeadPoint, _ ByVal flags As PixelateCommandFlags _ )
'Usage Dim cellWidth As Integer Dim cellHeight As Integer Dim opacity As Integer Dim centerPoint As LeadPoint Dim flags As PixelateCommandFlags Dim instance As New PixelateCommand(cellWidth, cellHeight, opacity, centerPoint, flags)
public PixelateCommand( int cellWidth, int cellHeight, int opacity, LeadPoint centerPoint, PixelateCommandFlags flags )
function PixelateCommand( cellWidth , cellHeight , opacity , centerPoint , flags )
public: PixelateCommand( int cellWidth, int cellHeight, int opacity, LeadPoint centerPoint, PixelateCommandFlags flags )
If these flags are set: | Then, the CellWidth property (or the cellWidth parameter) contains: | And the range of possible values is: |
PixelateCommandFlags.Radial | PixelateCommandFlags.WidthFrequency |
the number of cells around the center point. That is, the circle around the center point is divided into equal parts, based on the value in the CellWidth property (or the cellWidth parameter if you are using the Constructor) as shown below: |
1 to 360. The circle can be divided into anywhere from 1 to 360 equal parts. |
PixelateCommandFlags.Radial | PixelateCommandFlags.WidthPeriod |
the size, in degrees of the cells around the center point That is, the circle around the center point is divided into cells based on the number of degrees set in the CellWidth property (or the cellWidth parameter if you are using the Constructor), as shown below: |
1 to 360. The circle can be divided into cells of 1 degree to 360 degrees. |
PixelateCommandFlags.Rectangle | PixelateCommandFlags.WidthFrequency |
the number of cells present across the width of the image. | 1 to the image width, if there is no region. If there is a region, then the range of values is just the region width. |
PixelateCommandFlags.Rectangle | PixelateCommandFlags.WidthPeriod | |
the width of each rectangular cell, in pixels. | 1 to the image width, if there is no region. If there is a region, then the range of values is just the region width. |
If the following flag is set: | Then, the CellHeight property (or the cellHeight parameter if you are using the Constructor) contains: | And the range of possible values is: |
PixelateCommandFlags.Radial | PixelateCommandFlags.HeightFrequency |
the number of cells present along the radius of the circular cell. | 1 to the diagonal of the image, if there is no region. If there is a region, then the range of values is just the diagonal of the region rectangle. |
PixelateCommandFlags.Radial | PixelateCommandFlags.HeightPeriod |
the radial length of each circular cell, 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 just the diagonal of the region rectangle. |
PixelateCommandFlags.Rectangle | PixelateCommandFlags.HeightFrequency |
the number of cells present across the height of the image. | 1 to the image height, if there is no region. If there is a region, then the range of values is just the region height. |
PixelateCommandFlags.Rectangle | PixelateCommandFlags.HeightPeriod | |
the height of each rectangular cell, in pixels. | 1 to the image height, if there is no region. If there is a region, then the range of values is just the region height. |
Public Sub PixelateConstructorExample() Dim codecs As New RasterCodecs() codecs.ThrowExceptionsOnInvalidImages = True Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg")) ' Prepare the command Dim command As PixelateCommand = New PixelateCommand(5, 10, 100, New LeadPoint(CType((leadImage.Width \ 2), Integer), CType((leadImage.Height \ 2), Integer)), PixelateCommandFlags.Radial Or PixelateCommandFlags.WidthPeriod Or PixelateCommandFlags.HeightPeriod Or PixelateCommandFlags.Average) command.Run(leadImage) codecs.Save(leadImage, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24) End Sub Public NotInheritable Class LEAD_VARS Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" End Class
public void PixelateConstructorExample() { // Load an image RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Master.jpg")); // Prepare the command PixelateCommand command = new PixelateCommand(5, 10, 100, new LeadPoint((image.Width / 2), (image.Height / 2)), PixelateCommandFlags.Radial | PixelateCommandFlags.WidthPeriod | PixelateCommandFlags.HeightPeriod | PixelateCommandFlags.Average); command.Run(image); codecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "Result.jpg"), RasterImageFormat.Jpeg, 24); } static class LEAD_VARS { public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; }
[TestMethod] public async Task PixelateConstructorExample() { // Load an image RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; string srcFileName = @"Assets\Image1.cmp"; StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName); RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile)); // Prepare the command PixelateCommand command = new PixelateCommand(5, 10, 100, LeadPointHelper.Create((image.Width / 2), (image.Height / 2)), PixelateCommandFlags.Radial | PixelateCommandFlags.WidthPeriod | PixelateCommandFlags.HeightPeriod | PixelateCommandFlags.Average); command.Run(image); string destFileName = @"result.bmp"; StorageFile saveFile = await Tools.AppLocalFolder.CreateFileAsync(destFileName); await codecs.SaveAsync(image, LeadStreamFactory.Create(saveFile), RasterImageFormat.Bmp, 24); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2