---
title: "Bitmap.SetPixel Method "
canonical: https://www.graphicsmill.com/docs/gm/M_Aurigma_GraphicsMill_Bitmap_SetPixel_3_5b67216d.htm
product: "Graphics Mill"
---

# Bitmap.SetPixel Method 
 
Sets the color of the specified pixel in this [Bitmap](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md).
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```csharp
public void SetPixel(int x,int y,Color color
)
```
 
### Parameters
 
 - x
     - Type: System.Int32
The x-coordinate of the pixel to set.

 - y
     - Type: System.Int32
The y-coordinate of the pixel to set.

 - color
     - Type: [Aurigma.GraphicsMill.Color](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Color.htm.md)
A [Color](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Color.htm.md) that represents the color to assign to the specified pixel. It is recommended to make sure that this object has the same color space as the bitmap itself. If color spaces are not match (e.g. the bitmap is CMYK and this color is RGB), color will be automatically converted, but no color management will be applied.
 
## Remarks
  
This method was implemented for easy but slow access to pixels. It works ideally if you need to set one pixel value, for example, when you implement pencil tool.
 
## Examples
  
```csharp
bitmap.SetPixel(120, 100, RgbColor.Red);
var color = (RgbColor)(bitmap.GetPixel(100, 80));
```
   
## See Also

### Reference

- [Bitmap Class](https://www.graphicsmill.com/docs/gm/T_Aurigma_GraphicsMill_Bitmap.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm/N_Aurigma_GraphicsMill.htm.md)
