LEADTOOLS (Leadtools assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
SetPixel Method
See Also 
Leadtools Namespace > RasterImage Class : SetPixel Method



row
The zero-based row number of the pixel.
column
The zero-based column number of the pixel.
color
The color to assign to the pixel. If the image has 32 or 64-bits per pixel, the alpha value of this parameter is used in the pixel data.
row
The zero-based row number of the pixel.
column
The zero-based column number of the pixel.
color
The color to assign to the pixel. If the image has 32 or 64-bits per pixel, the alpha value of this parameter is used in the pixel data.
Changes the color value of the specified pixel. Supported in Silverlight, Windows Phone 7

Syntax

Visual Basic (Declaration) 
Public Sub SetPixel( _
   ByVal row As Integer, _
   ByVal column As Integer, _
   ByVal color As RasterColor _
) 
Visual Basic (Usage)Copy Code
Dim instance As RasterImage
Dim row As Integer
Dim column As Integer
Dim color As RasterColor
 
instance.SetPixel(row, column, color)
C# 
public void SetPixel( 
   int row,
   int column,
   RasterColor color
)
C++/CLI 
public:
void SetPixel( 
   int row,
   int column,
   RasterColor color
) 

Parameters

row
The zero-based row number of the pixel.
column
The zero-based column number of the pixel.
color
The color to assign to the pixel. If the image has 32 or 64-bits per pixel, the alpha value of this parameter is used in the pixel data.

Example

For an example, refer to GetPixel.

Remarks

This method uses image coordinates to specify the pixel. Therefore, you must account for the view perspective of the image. If you specify a pixel that is outside the image or outside the region (if the image has one), this method throws an exception.

Use the GetPixel method to get the color value of a certain pixel.

For 32 and 64-bit images, an alpha value is also available in the image. This method will use the alpha value in color (A). For 32-bit images, this will be the exact byte value of the alpha for the pixel. For 64-bit images, the alpha is 16-bit and since RasterColor.A is an 8-bit value, the alpha is normalized from its 16-bit value to 8-bit. For other bits/pixel values, the method is identical to returned from SetPixelColor.

This method does not support signed images.

For more information, refer to Introduction to Image Processing With LEADTOOLS.

For more information refer to Accounting for View Perspective.

Requirements

Target Platforms: Silverlight, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only), Windows Phone 7

See Also