CCanvas::CreateBitmap File not found

 

Hello,

wish you all good new year 2021.


I want to use 

CCanvas::CreateBitmap

to show a Bitmap on Chart. The Bitmap is loaded by:

CCanvas::LoadFromFile

Unfortuntely, i get always


File not found (5002)


returned.


The Bitmap definitely is in the mql4/images folder.

I checked out various path values, like:

        \\images\\short.bmp

or

full path

or just

        short.bmp


Always getting same error.


When using 

ObjectCreate

ObjectSetString(chart_ID,"my_name",OBJPROP_BMPFILE," \\images\\short.bmp ") 

...

the bitmap is found and shown on the chart.


(I use canvas, because i need a transparent bitmap and it seems CCanvas makes this somehow possible).


This is the code snippet:

double close=iClose(Symbol(),PERIOD_CURRENT,0);
string fn="\\Images\\short.bmp";
   
CCanvas* cv=new CCanvas;
bool bret=cv.CreateBitmap(0,0,"mb1",TimeCurrent(),close,400,400, COLOR_FORMAT_ARGB_RAW);
ResetLastError();
bret=cv.LoadFromFile(fn);
PrintFormat("error=%d",GetLastError());

What is wrong in my code ?
Thank you