Login Page - Create Account

Support Board


Date/Time: Sun, 05 May 2024 00:28:49 +0000



Post From: Region Background Color

[2023-11-15 23:57:38]
User719512 - Posts: 227
Interesting approach with CBBOAC.
Can also be done in ACSIL and GDI functions.

Code Snippet:


void DrawToChart(HWND WindowHandle, HDC DeviceContext, SCStudyInterfaceRef sc)
{
// easier to see in the debugger with locals
const int region_left = sc.StudyRegionLeftCoordinate;
const int region_top = sc.StudyRegionTopCoordinate;
const int region_right = sc.StudyRegionRightCoordinate;
const int region_bottom = sc.StudyRegionBottomCoordinate;

n_ACSIL::s_GraphicsRectangle Rectangle;
n_ACSIL::s_GraphicsColor Color;

Rectangle.Left = region_left;
Rectangle.Top = region_top;
Rectangle.Right = region_right;
Rectangle.Bottom = region_bottom;
Color.Color.RawColor = sc.Input[0].GetColor();
sc.Graphics.FillRectangleWithColor(Rectangle, Color);
}

I would have thought this study should be first in the list (and draw underneath the main subgraph), but I had to put it last for it to work as expected.
imageScreenshot 2023-11-15 154637.png / V - Attached On 2023-11-15 23:53:56 UTC - Size: 67.68 KB - 50 views