ImageGear .NET
Pixelate Method
Example 




Page to pixelate.
Fill parameters for pixelate operation. See ImGearPixelateFillParams description.
Parameters of the cell for pixelate operation. See ImGearPixelateCellParams description.
Parameters of cell borders. See ImGearPixelateBorderParams description.
This method divides an image into cells and fills every cell according to the cell and fill parameters.
Syntax
'Declaration
 
Public Shared Sub Pixelate( _
   ByVal page As ImGearRasterPage, _
   ByVal fillParameters As ImGearPixelateFillParams, _
   ByVal cellParameters As ImGearPixelateCellParams, _
   ByVal borderParameters As ImGearPixelateBorderParams _
) 
'Usage
 
Dim page As ImGearRasterPage
Dim fillParameters As ImGearPixelateFillParams
Dim cellParameters As ImGearPixelateCellParams
Dim borderParameters As ImGearPixelateBorderParams
 
ImGearEffects.Pixelate(page, fillParameters, cellParameters, borderParameters)

Parameters

page
Page to pixelate.
fillParameters
Fill parameters for pixelate operation. See ImGearPixelateFillParams description.
cellParameters
Parameters of the cell for pixelate operation. See ImGearPixelateCellParams description.
borderParameters
Parameters of cell borders. See ImGearPixelateBorderParams description.
Example
// Pixelate an image.

// Parameter classes for Pixelate method.
ImGearPixelateBorderParams igPixelateBorderParams = new ImGearPixelateBorderParams();
ImGearPixelateCellParams igPixelateCellParams = new ImGearPixelateCellParams();
ImGearPixelateFillParams igPixelateFillParams = new ImGearPixelateFillParams();

ImGearPixel igPixel = igRasterPage.DIB.GetPixelCopy(0, 0);

// cell parameters
igPixelateCellParams.Type = ImGearPixelateCellType.Rectangle;
igPixelateCellParams.Width = 8;
igPixelateCellParams.Height = 8;

// fill parameters
igPixelateFillParams.FillMethod = ImGearPixelateFillMethod.Average;
igPixelateFillParams.Color = igPixel;
igPixelateFillParams.Opacity = (float)1.00;
// Border parameters
igPixelateBorderParams.Width = 0;
igPixelateBorderParams.Height = 0;
igPixelateBorderParams.Color = igPixel;
igPixelateBorderParams.Opacity = (float)1.00;

ImGearEffects.Pixelate(igRasterPage,
        igPixelateFillParams,
        igPixelateCellParams,
        igPixelateBorderParams);
' Pixelate an image.

' Parameter classes for Pixelate function.
Dim igPixelateBorderParams As New ImGearPixelateBorderParams()
Dim igPixelateCellParams As New ImGearPixelateCellParams()
Dim igPixelateFillParams As New ImGearPixelateFillParams()

Dim igPixel As ImGearPixel = igRasterPage.DIB.GetPixelCopy(0, 0)

' cell parameters
igPixelateCellParams.Type = ImGearPixelateCellType.Rectangle
igPixelateCellParams.Width = 8
igPixelateCellParams.Height = 8

' fill parameters
igPixelateFillParams.FillMethod = ImGearPixelateFillMethod.Average
igPixelateFillParams.Color = igPixel
igPixelateFillParams.Opacity = CSng(1)
' Border parameters
igPixelateBorderParams.Width = 0
igPixelateBorderParams.Height = 0
igPixelateBorderParams.Color = igPixel
igPixelateBorderParams.Opacity = CSng(1)

ImGearEffects.Pixelate(igRasterPage, igPixelateFillParams, igPixelateCellParams, igPixelateBorderParams)
See Also

Reference

ImGearEffects Class
ImGearEffects Members
ImGearRasterPage Class
ImGearPixelateFillParams Class
ImGearPixelateCellParams Class
ImGearPixelateBorderParams Class

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback