Hi
I am trying to create a proc that will take a text and draw it on the chart, with a rectangular line/border around it.
I prefer to work with the GfxSetOverlayMode(1);
I would like to allow for a small margin between the text and the border. The size of the margin should be about 30% of the fost size. Is there a way to do this?
I did see the conversion functions between the coordinate systems in this page:
https://www.amibroker.com/guide/afl/status.html
Can I avoid using these?
GfxConvertBarToPixelX( bar )
GfxConvertValueToPixelY( Value )
Here is the code I came up. I still need to calculate margin_height and margin_width.
function PrintInCell( string, x1, y1, x2, y2, pformat )
{
GfxSetCoordsMode( 1 ); // bar/price mode (instead of pixel)
GfxSelectFont("Tahoma", 10 );
margin_height = 0;
margin_width = 0;
GfxRectangle( x1-margin_width, y1+margin_height, x2-margin_width, y2-margin_height ) ;
GfxDrawText( string, x1, y1, x2, y2 , pformat );
}