<div class="meta" robots="noindex">

</div>

Property

# Graphics.Pixel

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2016r1. Please use `RGBSurface</api/graphics/rgbsurface>` as a replacement.

</div>

## Description

Used to get and set the `color</api/data_types/color>` of a particular <span class="title-ref">Pixel</span>. You can do the same thing with `RGBSurface.Pixel<rgbsurface.pixel>` which is significantly faster.

## Notes

Pixel has been updated to properly support alpha channels by taking them into account when rendering them. Additionally, <span class="title-ref">Pixel</span> with always return `Nil</api/language/nil>` for pointers with alpha channels. For pictures without alpha channels, the mask functionality will continue to work.

In macOS builds, you can read from Graphics.Pixel only for `Graphics</api/graphics/graphics>` objects obtained from a `Picture</api/graphics/picture>`. Doing so from other `Graphics</api/graphics/graphics>` objects will result in an `UnsupportedOperationException</api/exceptions/unsupportedoperationexception>`. You can however assign a value to Graphics.Pixel for a `Graphics</api/graphics/graphics>` object obtained from any object.

## Sample code

This example assigns the color of a particular <span class="title-ref">Pixel</span> in a `Canvas</api/deprecated/canvas>` control to a variable.

``` xojo
Dim c As Color
c = Canvas1.Graphics.Pixel(10, 10)
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

This example sets a particular <span class="title-ref">Pixel</span> of a `Canvas</api/deprecated/canvas>` control to a specific `Color.RGB<color.rgb>` value.

``` xojo
Canvas1.Graphics.Pixel(10, 10) =Color.RGB(100, 105, 225)
```

## Compatibility

All project types on all supported operating systems.

## See also

`Graphics</api/graphics/graphics>` parent class; `RGBSurface</api/graphics/rgbsurface>` class.
