---
title: "Bitmap..::.SetPixel Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_SetPixel_3_5b67216d.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# Bitmap.SetPixel Method 
 
Sets pixel value at the specified coordinates.
 
**Namespace:** [Aurigma.GraphicsMill](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
 **Assembly:** Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
 
## Syntax
  
```
Public Sub SetPixel ( _x As Integer, _y As Integer, _color As Color _
)
```
 
```csharp
public void SetPixel(int x,int y,Color color
)
```
 
### Parameters
 
 - x
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Horizontal position of the pixel.

 - y
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Vertical position of the pixel.

 - color
     - Type: [Aurigma.GraphicsMill.Color](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Color.htm.md)
Color value to put into the bitmap at specified coordinates. 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. 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. However if you need iterate each pixel in bitmap, it will work too slow. In this case you should consider using [LockBits()](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_LockBits.htm.md) method instead. [LockBits()](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Bitmap_LockBits.htm.md) will provide you a direct access to pixels.
 
## Examples
  
```
bitmap.SetPixel(120, 100, Aurigma.GraphicsMill.RgbColor.Red)

Dim color As Aurigma.GraphicsMill.RgbColor = bitmap.GetPixel(100, 80)
```
 
```csharp
bitmap.SetPixel(120, 100, Aurigma.GraphicsMill.RgbColor.Red);

Aurigma.GraphicsMill.RgbColor color =
    (Aurigma.GraphicsMill.RgbColor)(bitmap.GetPixel(100, 80));
```
   
## See Also

### Reference

- [Bitmap Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
- [Aurigma.GraphicsMill Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill.htm.md)
