Login Page - Create Account

Support Board


Date/Time: Fri, 19 Jul 2024 17:18:33 +0000



How to use GDI to draw text with transparent background?

View Count: 148

[2024-05-26 22:43:39]
User719512 - Posts: 229
How to use GDI to draw text with transparent background?
Should you be able to specify a NULL background?


sc.Graphics.DrawTextAt(msg, x_coordinate, y_coordinate);

Also, does the sc.Graphics.SetTextColor support setting an Alpha value?


// nothing like this seems to have an effect
//
sc.Graphics.ResetBackgroundColor();
sc.Graphics.ResetBackgroundMode();
n_ACSIL::s_GraphicsPen nullPen;
nullPen.m_PenStyle = n_ACSIL::s_GraphicsPen::e_PenStyle::PEN_STYLE_NULL;
sc.Graphics.SetPen(nullPen);
n_ACSIL::s_GraphicsBrush nullBrush;
nullBrush.m_BrushType = n_ACSIL::s_GraphicsBrush::BRUSH_TYPE_STOCK;
nullBrush.m_BrushStockType = NULL_BRUSH;
sc.Graphics.SetBrush(nullBrush);

GraphicsColor_Foreground.Color.RGB.Alpha = 128;
GraphicsColor_Foreground.Color.RGB.Red = 0;
GraphicsColor_Foreground.Color.RGB.Green = 128;
GraphicsColor_Foreground.Color.RGB.Blue = 0;
sc.Graphics.SetTextColor(GraphicsColor_Foreground);

[2024-05-27 10:01:02]
User431178 - Posts: 452
How to use GDI to draw text with transparent background?


sc.Graphics.SetBackgroundMode(TRANSPARENT);

[2024-05-27 14:20:59]
Sierra_Chart Engineering - Posts: 15529
Yes this is correct:
sc.Graphics.SetBackgroundMode(TRANSPARENT);

No:

Also, does the sc.Graphics.SetTextColor support setting an Alpha value?

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account