• part-08 5984eecdf8

    Sandro Begashvili выпуск опубликован 2026-10-03 09:52:34 +00:00 | 3 коммиты main с этого выпуска

    Cairo G2D — a 2D vector graphics engine in pure MQL5

    Source code for the mql5.com article series Creating a Cairo-Inspired Graphics Library for MetaTrader 5.

    Part 1: https://www.mql5.com/en/articles/23818

    Part 2: https://www.mql5.com/en/articles/23993

    Part 3: https://www.mql5.com/en/articles/24165

    Part 4: https://www.mql5.com/en/articles/24259

    Part 5: https://www.mql5.com/en/articles/24315

    Part 6: https://www.mql5.com/en/articles/24569

    Part 7: https://www.mql5.com/en/articles/24632

    Part 8: https://www.mql5.com/en/articles/24658

    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.


    Which version do I want?

    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.

    Release Article What it adds
    part-01 Part 1 — Why the Terminal Needs Its Own 2D Renderer Color.mqh, Surface.mqh — the ARGB type and the buffer-to-chart bridge
    part-02 Part 2 — Points, Contours and the Path Path.mqh — points, contours, the path
    part-03 Part 3 — Edges and the First Filled Shape Path.mqh & Raster.mqh — the scanline fill
    part-04 Part 4 — Anti-Aliasing, Coverage and Compositing Config.mqh & Raster.mqh — coverage and compositing
    part-05 Part 5 — Fill Rules, Holes and Borders Path.mqh & Raster.mqh — fill rules and holes
    part-06 Part 6 — Curves and Adaptive Flattening Path.mqh & Config.mqh — cubic Bezier and recursive subdivision to flatten the curves
    part-07 Part 7 — Arcs, Circles and Rounded Rectangles Path.mqh — ArcTo, AddCircle, AddEllipse, AddRoundRect
    part-08 Part 8 — Paint, from Solid Colors to Gradients Paint.mqh, Raster.mqh — The color source, and the two gradients

    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.


    Installing

    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:

    MQL5/
    ├── Include/
    │   └── CairoG2D/
    │       ├── Color.mqh          the ARGB color type
    │       ├── Surface.mqh        pixel buffer bound to one chart object
    │       ├── Path.mqh           points, contours, the path
    │       ├── Raster.mqh         the scanline fill
    │       ├── Paint.mqh          The color source, and the two gradients
    │       ├── Config.mqh         CairoAaSamples - the quality dial
    │       └── DemoTheme.mqh      the demos' shared palette - NOT library code
    └── Experts/
        └── CairoG2D/
            ├── Article 01/
            │   └── Demo01_FirstPixels.mq5
            ├── Article 02/
            │   └── Demo02_PathViewer.mq5
            ├── Article 03/
            │   └── Demo03_FirstFill.mq5
            ├── Article 04/
            │   └── Demo04_AntiAliasing.mq5
            ├── Article 05/
            │   └── Demo05_FillRules.mq5
            ├── Article 06/
            │   └── Demo06_Curves.mq5
            ├── Article 07/
            │   └── Demo07_RoundRect.mq5
            └── Article 08/
                └── Demo08_Paint.mq5
    

    Then open the demo in MetaEditor, compile with F7, and drag it onto any chart. It needs no inputs, no indicators and no market data.

    The library headers are included the usual way:

    #include <CairoG2D/Color.mqh>
    #include <CairoG2D/Surface.mqh>
    

    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.


    Scope

    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.


    Removing it

    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.


    Copyright 2026, Sandro Begashvili

    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.

    If you build something with it, I would genuinely like to see it — the Telegram link above is the fastest way to reach me.

    Загрузки
  • part-07 712ccf1613

    Sandro Begashvili выпуск опубликован 2026-10-03 09:49:14 +00:00 | 4 коммиты main с этого выпуска

    Cairo G2D — a 2D vector graphics engine in pure MQL5

    Source code for the mql5.com article series Creating a Cairo-Inspired Graphics Library for MetaTrader 5.

    Part 1: https://www.mql5.com/en/articles/23818

    Part 2: https://www.mql5.com/en/articles/23993

    Part 3: https://www.mql5.com/en/articles/24165

    Part 4: https://www.mql5.com/en/articles/24259

    Part 5: https://www.mql5.com/en/articles/24315

    Part 6: https://www.mql5.com/en/articles/24569

    Part 7: https://www.mql5.com/en/articles/24632

    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.


    Which version do I want?

    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.

    Release Article What it adds
    part-01 Part 1 — Why the Terminal Needs Its Own 2D Renderer Color.mqh, Surface.mqh — the ARGB type and the buffer-to-chart bridge
    part-02 Part 2 — Points, Contours and the Path Path.mqh — points, contours, the path
    part-03 Part 3 — Edges and the First Filled Shape Path.mqh & Raster.mqh — the scanline fill
    part-04 Part 4 — Anti-Aliasing, Coverage and Compositing Config.mqh & Raster.mqh — coverage and compositing
    part-05 Part 5 — Fill Rules, Holes and Borders Path.mqh & Raster.mqh — fill rules and holes
    part-06 Part 6 — Curves and Adaptive Flattening Path.mqh & Config.mqh — cubic Bezier and recursive subdivision to flatten the curves
    part-07 Part 7 — Arcs, Circles and Rounded Rectangles Path.mqh — ArcTo, AddCircle, AddEllipse, AddRoundRect

    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.


    Installing

    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:

    MQL5/
    ├── Include/
    │   └── CairoG2D/
    │       ├── Color.mqh          the ARGB color type
    │       ├── Surface.mqh        pixel buffer bound to one chart object
    │       ├── Path.mqh           points, contours, the path
    │       ├── Raster.mqh         the scanline fill
    │       ├── Paint.mqh          The color source, and the two gradients
    │       ├── Config.mqh         CairoAaSamples - the quality dial
    │       └── DemoTheme.mqh      the demos' shared palette - NOT library code
    └── Experts/
        └── CairoG2D/
            ├── Article 01/
            │   └── Demo01_FirstPixels.mq5
            ├── Article 02/
            │   └── Demo02_PathViewer.mq5
            ├── Article 03/
            │   └── Demo03_FirstFill.mq5
            ├── Article 04/
            │   └── Demo04_AntiAliasing.mq5
            ├── Article 05/
            │   └── Demo05_FillRules.mq5
            ├── Article 06/
            │   └── Demo06_Curves.mq5
            └── Article 07/
                └── Demo07_RoundRect.mq5
    
    

    Then open the demo in MetaEditor, compile with F7, and drag it onto any chart. It needs no inputs, no indicators and no market data.

    The library headers are included the usual way:

    #include <CairoG2D/Color.mqh>
    #include <CairoG2D/Surface.mqh>
    

    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.


    Scope

    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.


    Removing it

    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.


    Copyright 2026, Sandro Begashvili

    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.

    If you build something with it, I would genuinely like to see it — the Telegram link above is the fastest way to reach me.

    Загрузки
  • part-06 78688eac11

    Sandro Begashvili выпуск опубликован 2026-09-09 09:44:15 +00:00 | 12 коммиты main с этого выпуска

    Cairo G2D — a 2D vector graphics engine in pure MQL5

    Source code for the mql5.com article series Creating a Cairo-Inspired Graphics Library for MetaTrader 5.

    Part 1: https://www.mql5.com/en/articles/23818

    Part 2: https://www.mql5.com/en/articles/23993

    Part 3: https://www.mql5.com/en/articles/24165

    Part 4: https://www.mql5.com/en/articles/24259

    Part 5: https://www.mql5.com/en/articles/24315

    Part 6: https://www.mql5.com/en/articles/24569

    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.


    Which version do I want?

    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.

    Release Article What it adds
    part-01 Part 1 — Why the Terminal Needs Its Own 2D Renderer Color.mqh, Surface.mqh — the ARGB type and the buffer-to-chart bridge
    part-02 Part 2 — Points, Contours and the Path Path.mqh — points, contours, the path
    part-03 Part 3 — Edges and the First Filled Shape Path.mqh & Raster.mqh — the scanline fill
    part-04 Part 4 — Anti-Aliasing, Coverage and Compositing Config.mqh & Raster.mqh — coverage and compositing
    part-05 Part 5 — Fill Rules, Holes and Borders Path.mqh & Raster.mqh — fill rules and holes
    part-06 Part 6 — Curves and Adaptive Flattening Path.mqh & Config.mqh — cubic Bezier and recursive subdivision to flatten the curves

    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.


    Installing

    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:

    MQL5/
    ├── Include/
    │   └── CairoG2D/
    │       ├── Color.mqh          the ARGB color type
    │       ├── Surface.mqh        pixel buffer bound to one chart object
    │       ├── Path.mqh           points, contours, the path
    │       ├── Raster.mqh         the scanline fill
    │       ├── Config.mqh         CairoAaSamples - the quality dial
    │       └── DemoTheme.mqh      the demos' shared palette - NOT library code
    └── Experts/
        └── CairoG2D/
            ├── Article 01/
            │   └── Demo01_FirstPixels.mq5
            ├── Article 02/
            │   └── Demo02_PathViewer.mq5
            ├── Article 03/
            │   └── Demo03_FirstFill.mq5
            ├── Article 04/
            │   └── Demo04_AntiAliasing.mq5
            ├── Article 05/
            │   └── Demo05_FillRules.mq5
            └── Article 06/
                └── Demo06_Curves.mq5
    

    Then open the demo in MetaEditor, compile with F7, and drag it onto any chart. It needs no inputs, no indicators and no market data.

    The library headers are included the usual way:

    #include <CairoG2D/Color.mqh>
    #include <CairoG2D/Surface.mqh>
    

    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.


    Scope

    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.


    Removing it

    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.


    Copyright 2026, Sandro Begashvili

    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.

    If you build something with it, I would genuinely like to see it — the Telegram link above is the fastest way to reach me.

    Загрузки
  • part-05 607e1b34a6

    Sandro Begashvili выпуск опубликован 2026-09-05 12:27:50 +00:00 | 13 коммиты main с этого выпуска

    Cairo G2D — a 2D vector graphics engine in pure MQL5

    Source code for the mql5.com article series Creating a Cairo-Inspired Graphics Library for MetaTrader 5.

    Part 1: https://www.mql5.com/en/articles/23818

    Part 2: https://www.mql5.com/en/articles/23993

    Part 3: https://www.mql5.com/en/articles/24165

    Part 4: https://www.mql5.com/en/articles/24259

    Part 5: https://www.mql5.com/en/articles/24315

    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.


    Which version do I want?

    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.

    Release Article What it adds
    part-01 Part 1 — Why the Terminal Needs Its Own 2D Renderer Color.mqh, Surface.mqh — the ARGB type and the buffer-to-chart bridge
    part-02 Part 2 — Points, Contours and the Path Path.mqh — points, contours, the path
    part-03 Part 3 — Edges and the First Filled Shape Path.mqh & Raster.mqh — the scanline fill
    part-04 Part 4 — Anti-Aliasing, Coverage and Compositing Config.mqh & Raster.mqh — coverage and compositing
    part-05 Part 5 — Fill Rules, Holes and Borders Path.mqh & Raster.mqh — fill rules and holes

    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.


    Installing

    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:

    MQL5/
    ├── Include/
    │   └── CairoG2D/
    │       ├── Color.mqh          the ARGB color type
    │       ├── Surface.mqh        pixel buffer bound to one chart object
    │       ├── Path.mqh           points, contours, the path
    │       ├── Raster.mqh         the scanline fill
    │       ├── Config.mqh         CairoAaSamples - the quality dial
    │       └── DemoTheme.mqh      the demos' shared palette - NOT library code
    └── Experts/
        └── CairoG2D/
            ├── Article 01/
            │   └── Demo01_FirstPixels.mq5
            ├── Article 02/
            │   └── Demo02_PathViewer.mq5
            ├── Article 03/
            │   └── Demo03_FirstFill.mq5
            ├── Article 04/
            │   └── Demo04_AntiAliasing.mq5
            └── Article 05/
                   └── Demo05_FillRules.mq5
    

    Then open the demo in MetaEditor, compile with F7, and drag it onto any chart. It needs no inputs, no indicators and no market data.

    The library headers are included the usual way:

    #include <CairoG2D/Color.mqh>
    #include <CairoG2D/Surface.mqh>
    

    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.


    Scope

    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.


    Removing it

    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.


    Copyright 2026, Sandro Begashvili

    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.

    If you build something with it, I would genuinely like to see it — the Telegram link above is the fastest way to reach me.

    Загрузки
  • part-04 ddb4aa6a39

    Sandro Begashvili выпуск опубликован 2026-08-31 14:11:00 +00:00 | 16 коммиты main с этого выпуска

    Cairo G2D — a 2D vector graphics engine in pure MQL5

    Source code for the mql5.com article series Creating a Cairo-Inspired Graphics Library for MetaTrader 5.

    Part 1: https://www.mql5.com/en/articles/23818

    Part 2: https://www.mql5.com/en/articles/23993

    Part 3: https://www.mql5.com/en/articles/24165

    Part 4: https://www.mql5.com/en/articles/24259

    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.


    Which version do I want?

    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.

    Release Article What it adds
    part-01 Part 1 — Why the Terminal Needs Its Own 2D Renderer Color.mqh, Surface.mqh — the ARGB type and the buffer-to-chart bridge
    part-02 Part 2 — Points, Contours and the Path Path.mqh — points, contours, the path
    part-03 Part 3 — Edges and the First Filled Shape Path.mqh & Raster.mqh — the scanline fill
    part-04 Part 4 — Anti-Aliasing, Coverage and Compositing Config.mqh & Raster.mqh — coverage and compositing

    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.


    Installing

    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:

    MQL5/
    ├── Include/
    │   └── CairoG2D/
    │       ├── Color.mqh          the ARGB color type
    │       ├── Surface.mqh        pixel buffer bound to one chart object
    │       ├── Path.mqh           points, contours, the path
    │       ├── Raster.mqh         the scanline fill
    │       ├── Config.mqh         CairoAaSamples - the quality dial
    │       └── DemoTheme.mqh      the demos' shared palette - NOT library code
    └── Experts/
        └── CairoG2D/
            ├── Article 01/
            │   └── Demo01_FirstPixels.mq5
            ├── Article 02/
            │   └── Demo02_PathViewer.mq5
            ├── Article 03/
            │   └── Demo03_FirstFill.mq5
            └── Article 04/
                 └── Demo04_AntiAliasing.mq5
    

    Then open the demo in MetaEditor, compile with F7, and drag it onto any chart. It needs no inputs, no indicators and no market data.

    The library headers are included the usual way:

    #include <CairoG2D/Color.mqh>
    #include <CairoG2D/Surface.mqh>
    

    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.


    Scope

    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.


    Removing it

    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.


    Copyright 2026, Sandro Begashvili

    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.

    If you build something with it, I would genuinely like to see it — the Telegram link above is the fastest way to reach me.

    Загрузки
  • part-03 ff91ecc68d

    Sandro Begashvili выпуск опубликован 2026-08-23 20:33:11 +00:00 | 22 коммиты main с этого выпуска

    Cairo G2D — a 2D vector graphics engine in pure MQL5

    Source code for the mql5.com article series Creating a Cairo-Inspired Graphics Library for MetaTrader 5.

    Part 1: https://www.mql5.com/en/articles/23818

    Part 2: https://www.mql5.com/en/articles/23993

    Part 3: https://www.mql5.com/en/articles/24165

    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.


    Which version do I want?

    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.

    Release Article What it adds
    part-01 Part 1 — Why the Terminal Needs Its Own 2D Renderer Color.mqh, Surface.mqh — the ARGB type and the buffer-to-chart bridge
    part-02 Part 2 — Points, Contours and the Path Path.mqh — points, contours, the path
    part-03 Part 3 — Edges and the First Filled Shape 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.


    Installing

    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:

    MQL5/
    ├── Include/
    │   └── CairoG2D/
    │       ├── Color.mqh          the ARGB color type
    │       ├── Surface.mqh        pixel buffer bound to one chart object
    │       ├── Path.mqh           points, contours, the path
    │       ├── Raster.mqh         the scanline fill
    │       └── DemoTheme.mqh      the demos' shared palette - NOT library code
    └── Experts/
        └── CairoG2D/
            ├── Article 01/
            │   └── Demo01_FirstPixels.mq5
            ├── Article 02/
            │   └── Demo02_PathViewer.mq5
            └── Article 03/
                └── Demo03_FirstFill.mq5
    
    

    Then open the demo in MetaEditor, compile with F7, and drag it onto any chart. It needs no inputs, no indicators and no market data.

    The library headers are included the usual way:

    #include <CairoG2D/Color.mqh>
    #include <CairoG2D/Surface.mqh>
    

    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.


    Scope

    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.


    Removing it

    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.


    Copyright 2026, Sandro Begashvili

    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.

    If you build something with it, I would genuinely like to see it — the Telegram link above is the fastest way to reach me.

    Загрузки
  • part-02 ed03414340

    Sandro Begashvili выпуск опубликован 2026-08-18 21:07:16 +00:00 | 33 коммиты main с этого выпуска

    Cairo G2D — a 2D vector graphics engine in pure MQL5

    Source code for the mql5.com article series "Cairo-Style Graphics in MQL5".

    Part 1: https://www.mql5.com/en/articles/23818

    Part 2: https://www.mql5.com/en/articles/23993

    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.


    Which version do I want?

    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.

    Release Article What it adds
    part-01 Part 1 — Why the Terminal Needs Its Own 2D Renderer Color.mqh, Surface.mqh — the ARGB type and the buffer-to-chart bridge
    part-02 Part 2 — Points, Contours and the Path Path.mqh — points, contours, the path

    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.


    Installing

    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:

    MQL5/
    ├── Include/
    │   └── CairoG2D/
    │       ├── Color.mqh          the ARGB color type
    │       ├── Surface.mqh        pixel buffer bound to one chart object
    │       ├── Path.mqh           points, contours, the path
    │       └── DemoTheme.mqh      the demos' shared palette - NOT library code
    └── Experts/
        └── CairoG2D/
            ├── Article 01/
            │   └── Demo01_FirstPixels.mq5
            └── Article 02/
                └── Demo02_PathViewer.mq5
    

    Then open the demo in MetaEditor, compile with F7, and drag it onto any
    chart. It needs no inputs, no indicators and no market data.

    The library headers are included the usual way:

    #include <CairoG2D/Color.mqh>
    #include <CairoG2D/Surface.mqh>
    

    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.


    Scope

    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.


    Removing it

    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.


    Copyright 2026, Sandro Begashvili

    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.

    If you build something with it, I would genuinely like to see it — the Telegram
    link above is the fastest way to reach me.

    Загрузки
  • part-01 2971b9074c

    Sandro Begashvili выпуск опубликован 2026-08-13 09:42:49 +00:00 | 39 коммиты main с этого выпуска

    Cairo G2D — a 2D vector graphics engine in pure MQL5

    Source code for the mql5.com article series "Creating a Cairo-Inspired Graphics Library for MetaTrader 5".
    Part 1: https://www.mql5.com/en/articles/23818

    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.


    Which version do I want?

    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.

    Release Article What it adds
    part-01 Part 1 — Why the Terminal Needs Its Own 2D Renderer Color.mqh, Surface.mqh — the ARGB type and the buffer-to-chart bridge

    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.


    Installing

    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:

    MQL5/
    ├── Include/
    │   └── CairoG2D/
    │       ├── Color.mqh          the ARGB color type
    │       ├── Surface.mqh        pixel buffer bound to one chart object
    │       └── DemoTheme.mqh      the demos' shared palette - NOT library code
    └── Experts/
        └── CairoG2D/
            └── Article 01/
                └── Demo01_FirstPixels.mq5
    

    Then open the demo in MetaEditor, compile with F7, and drag it onto any
    chart. It needs no inputs, no indicators and no market data.

    The library headers are included the usual way:

    #include <CairoG2D/Color.mqh>
    #include <CairoG2D/Surface.mqh>
    

    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.


    Scope

    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.


    Removing it

    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.


    Copyright 2026, Sandro Begashvili

    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.

    If you build something with it, I would genuinely like to see it — the Telegram
    link above is the fastest way to reach me.

    Загрузки