←Select platform

SetPixelColor Method

Summary

Changes the color value of the specified pixel.

Syntax

C#
VB
Java
Objective-C
WinRT C#
C++
public void SetPixelColor( 
   int row, 
   int column, 
   RasterColor color 
) 
Public Sub SetPixelColor( _ 
   ByVal row As Integer, _ 
   ByVal column As Integer, _ 
   ByVal color As Leadtools.RasterColor _ 
)  
public void SetPixelColor(  
   int row, 
   int column, 
   Leadtools.RasterColor color 
) 
- (BOOL)setColor:(LTRasterColor *)color  
   forPixelAtRow:(NSInteger)row  
          column:(NSInteger)column  
           error:(NSError **)error 
             
public void setPixelColor( 
  int row,  
  int column,  
  RasterColor color 
) 
             
 function Leadtools.RasterImage.SetPixelColor(  
   row , 
   column , 
   color  
) 
public: 
void SetPixelColor(  
   int row, 
   int column, 
   Leadtools.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.

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 GetPixelColor method to get the color value of a certain pixel.

This method does not support alpha values for 32 and 64-bit color images and the alpha value of color is not be used. Instead, use the GetPixel and SetPixel methods.

This method supports unsigned data images, but not signed ones.

The SetPixelColor function can use the Extended Grayscale mask. For more information, refer to Grayscale Images

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

For more information refer to Accounting for View Perspective.

In the Document and Medical toolkits, the COLORREF value can represent a 16 bit grayscale value if RasterImage is a 12 or 16-bit grayscale bitmap. To avoid confusion with an RGB value, set the COLORREF_GRAY16 mask (0x04000000). In this case (0x0400YYYY), the lower 16 bits (0xYYYY) of the COLORREF value represent the 16-bit grayscale value. (0x0400FFFF is 16-bit white and 0x04000000 is 16-bit black.) This is not a standard Windows value. Therefore, although LEADTOOLS methods will recognize a COLORREF having this format, but Windows methods will not.

Example

For an example, refer to GetPixelColor.

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly