A scanline rasteriser, path model and compositing pipeline written from scratch in MQL5, with no external libraries and no `CCanvas`. Everything it draws goes into one `OBJ_BITMAP_LABEL`, so a panel of a thousand shapes still costs the terminal exactly one chart object.
**Use the release that matches the article you are reading.** Each part of the series has its own release, frozen at the state the article explains — so if you are reading Part 1, the Part 1 release contains two header files and one demo, and nothing you have not read about yet.
| [`part-01`](https://forge.mql5.io/SandroBegashvil/CairoG2D/releases/tag/part-01) | [Part 1 — Why the Terminal Needs Its Own 2D Renderer](https://www.mql5.com/en/articles/23818) | `Color.mqh`, `Surface.mqh` — the ARGB type and the buffer-to-chart bridge |
| [`part-02`](https://forge.mql5.io/SandroBegashvil/CairoG2D/releases/tag/part-02) | [Part 2 — Points, Contours and the Path](https://www.mql5.com/en/articles/23993) | `Path.mqh` — points, contours, the path |
2026-08-19 19:58:01 +04:00
| [`part-03`](https://forge.mql5.io/SandroBegashvil/CairoG2D/releases/tag/part-03) | [Part 3 — Edges and the First Filled Shape](https://www.mql5.com/en/articles/24165) | `Path.mqh` & `Raster.mqh` — the scanline fill |
Later parts are added to this table as they are published. The `main` branch is always the newest state, which will be ahead of every published article.
Download the release archive and extract it over your terminal's data folder (**File → Open Data Folder** in MetaTrader 5). The archive already has the right shape, so the files land where they belong:
2026-08-13 13:36:58 +04:00
```text
MQL5/
├── Include/
│ └── CairoG2D/
│ ├── Color.mqh the ARGB color type
│ ├── Surface.mqh pixel buffer bound to one chart object
`DemoTheme.mqh` is deliberately shipped alongside them but is **not** part of the engine. It holds the light palette and the chart setup that make every screenshot in the series look the same, and nothing in the renderer depends on it.
This is a software rasteriser aimed at **interface redraw** — panels that are repainted when something happens, not scenes animated at a high frame rate. It uses **straight (non-premultiplied) alpha from input to output**, which is what `COLOR_FORMAT_ARGB_NORMALIZE` expects.
Each demo draws into a single chart object and deletes that object on `OnDeinit`, so removing the Expert Advisor leaves the chart exactly as it was found. Nothing is written outside the terminal's data folder.
You are free to **use this code in your own projects and to extend it**, commercially or otherwise. The only thing asked in return is attribution: keep a mention of the author's mql5.com profile in the source you derive from it.