# 2D Graphics
DWScript provides built-in support for low-level 2D buffer manipulation through the `TPixmap` class. No `uses` clause is required.
## Creating a Pixmap
A Pixmap is an array of ARGB (Alpha, Red, Green, Blue) values. You can create one with a specific width and height.
```pascal
var bmp := CreatePixmap(100, 100);
// Draw a pixel
bmp.SetPixel(10, 10, $FFFF0000); // Red pixel at 10,10
// OUTPUT NONE
```
## Colors
Colors are represented as 32-bit integers in `$AARRGGBB` format.
```pascal
var red := $FFFF0000;
var transparentGreen := $8000FF00;
// OUTPUT NONE
```
## Exporting Data
You can retrieve the raw buffer data as a hex string for transfer to a browser or saving to a file.
```pascal
var bmp := CreatePixmap(10, 10);
var data := bmp.ToHexString;
PrintLn('Hex data length: ' + IntToStr(data.Length));
// OUTPUT
// Hex data length: 800
```
:::info
### Related Reference
For details on coordinate systems and performance-optimized data access, see the reference documentation:
* **[Graphics API Reference](/ref/graphics)** - Complete list of methods.
:::
2D Graphics
DWScript provides built-in support for low-level 2D buffer manipulation through the TPixmap class. No uses clause is required.
Creating a Pixmap
A Pixmap is an array of ARGB (Alpha, Red, Green, Blue) values. You can create one with a specific width and height.
var bmp := CreatePixmap(100,100);// Draw a pixel
bmp.SetPixel(10,10,$FFFF0000);// Red pixel at 10,10
Colors
Colors are represented as 32-bit integers in $AARRGGBB format.
var red :=$FFFF0000;var transparentGreen :=$8000FF00;
Exporting Data
You can retrieve the raw buffer data as a hex string for transfer to a browser or saving to a file.
var bmp := CreatePixmap(10,10);var data := bmp.ToHexString;
PrintLn('Hex data length: '+ IntToStr(data.Length));
Result
Hex data length: 800
Related Reference
For details on coordinate systems and performance-optimized data access, see the reference documentation: