{"id":72,"date":"2008-04-21T04:41:19","date_gmt":"2008-04-21T09:41:19","guid":{"rendered":"http:\/\/www.amibroker.com\/kb\/?p=72"},"modified":"2014-12-04T08:30:12","modified_gmt":"2014-12-04T13:30:12","slug":"big-symbol-text-in-the-background","status":"publish","type":"post","link":"https:\/\/www.amibroker.com\/wordpress\/kb\/2008\/04\/21\/big-symbol-text-in-the-background\/","title":{"rendered":"Big symbol text in the background"},"content":{"rendered":"

Recently I heard the suggestion to add a security symbol written in big letters in the chart background. Well, actually it is pretty simple to do using low-level gfx. Just add this code sniplet anywhere in your chart formula.<\/p>GfxSetOverlayMode<\/span>(<\/span>1<\/span>);
<\/span>GfxSelectFont<\/span>(<\/span>"Tahoma"<\/span>, <\/span>Status<\/span>(<\/span>"pxheight"<\/span>)\/<\/span>2 <\/span>);
<\/span>GfxSetTextAlign<\/span>( <\/span>6 <\/span>);<\/span>\/\/ center alignment
<\/span>GfxSetTextColor<\/span>( <\/span>ColorRGB<\/span>( <\/span>200<\/span>, <\/span>200<\/span>, <\/span>200 <\/span>) );
<\/span>GfxSetBkMode<\/span>(<\/span>1<\/span>); <\/span>\/\/ transparent
<\/span>GfxTextOut<\/span>( <\/span>Name<\/span>(), <\/span>Status<\/span>(<\/span>"pxwidth"<\/span>)\/<\/span>2<\/span>, <\/span>Status<\/span>(<\/span>"pxheight"<\/span>)\/<\/span>12 <\/span>)<\/code>

UPDATE: I have added transparent mode, so it works fine on non-white backgrounds too.<\/p>","protected":false},"excerpt":{"rendered":"

Recently I heard the suggestion to add a security symbol written in big letters in the chart background. Well, actually it is pretty simple to do using low-level gfx. Just add this code sniplet anywhere in your chart formula.GfxSetOverlayMode(1);GfxSelectFont("Tahoma", Status("pxheight")\/2 );GfxSetTextAlign( 6 );\/\/ center alignmentGfxSetTextColor( ColorRGB( 200, 200, 200 ) );GfxSetBkMode(1); \/\/ transparentGfxTextOut( Name(), Status("pxwidth")\/2, Status("pxheight")\/12 )UPDATE: I have added transparent mode, so it works fine on non-white backgrounds too.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[53,55],"_links":{"self":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/72"}],"collection":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":1,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":788,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/72\/revisions\/788"}],"wp:attachment":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}