---
title: "GdiGraphics..::.SetPixel Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Drawing_GdiGraphics_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/)

# GdiGraphics.SetPixel Method 
 
Writes a color of a pixel at specified coordinates.
 
**Namespace:** [Aurigma.GraphicsMill.Drawing](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.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 coordinate of the pixel you are changing.

 - y
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Vertical coordinate of the pixel you are changing.

 - color
     - Type: [Aurigma.GraphicsMill.Color](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Color.htm.md)
A color of the pixel you want to write to the specified coordinates.
 
## Remarks
  
If the current [GdiGraphics](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_GdiGraphics.htm.md) instance is opened for a device context, you should remember than not all devices have per-pixel access support. Also, the coordinates must be inside the clipping region.
 
**Note** 
This method works quite slow. It is ok to use it to write one color value, but if you need to process multiple pixels, it would be much faster to use direct access to memory.
   
## See Also

### Reference

- [GdiGraphics Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Drawing_GdiGraphics.htm.md)
- [Aurigma.GraphicsMill.Drawing Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Drawing.htm.md)
- [GdiGraphics.GetPixel(Int32, Int32)](https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Drawing_GdiGraphics_GetPixel_2_22dcb54d.htm.md)
