//+------------------------------------------------------------------+ //| CanvasSample.mq5 | //| Copyright 2000-2025, MetaQuotes Ltd. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2000-2025, MetaQuotes Ltd." #property link "https://www.mql5.com" #property description "Demonstrating Canvas features" //--- #include //+------------------------------------------------------------------+ //| inputs | //+------------------------------------------------------------------+ input int Width=800; input int Height=600; //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ int OnStart(void) { int total=1024; int limit=MathMax(Width,Height); int x1,x2,x3,y1,y2,y3,r; int x[],y[]; //--- check if(Width<100 || Height<100) { Print("Too simple."); return(-1); } //--- create canvas CCanvas canvas; if(!canvas.CreateBitmapLabel("SampleCanvas",0,0,Width,Height,COLOR_FORMAT_ARGB_RAW)) { Print("Error creating canvas: ",GetLastError()); return(-1); } //--- deawing canvas.Erase(XRGB(0x1F,0x1F,0x1F)); canvas.Update(); //--- start randomizer srand(GetTickCount()); //--- draw pixels for(int i=0;i