OBJPROP_ANCHOR not working objects of type OBJ_BITMAP

 

Hello all, I have tried everything, I cannot get CCanvas' underlying OBJ_BITMAP to obey its OBJPROP_ANCHOR.

I tried the obvious :

        m_canvas = new CCanvas();
        m_canvas.CreateBitmap(m_objName, m_endTime, price, 150, 50, COLOR_FORMAT_ARGB_RAW);
        m_canvas.FontSet("Consolas", -80);
        m_canvas.FillRectangle(0, 0, 150, 50, ColorToARGB(clrPurple));
        m_canvas.TextOut(0, 0, caption, ColorToARGB(clrLime), TA_LEFT | TA_TOP);
        m_canvas.Update();

        ObjectSetInteger(0, m_objName, OBJPROP_ANCHOR, ANCHOR_CENTER);

Looking at documentation located here : https://www.mql5.com/en/docs/constants/objectconstants/enum_anchorpoint

OBJ_BITMAP should work with  OBJPROP_ANCHOR

Thanks for shedding any lights on this!

Edit: Also tested with an OBJ_BITMAP directly, not going through CCanvas, same thing happens.

Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Methods of Object Binding
Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Methods of Object Binding
  • www.mql5.com
Methods of Object Binding - Objects Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
What makes you think it's "not working" ?
 
it shall be in strategy tester. it doesn't work in strategy tester, at least some months ago it was not working. don't know if they have fixed it.
 
Alain Verleyen #:
What makes you think it's "not working" ?

I guess what he means is set text alignment to center.

 
Alain Verleyen #:
What makes you think it's "not working" ?

The bitmap object is not obeying the anchor.


So I gave up on this and used  CChartObjectText and CChartObjectTrend to achieve my drawing needs.