Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 12:02:22 +0000



Post From: DrawOutlineOnly non-functional

[2018-01-10 17:37:38]
binaryduke - Posts: 360
Hi SC

I have conducted some quick and dirty testing on the DrawOutlineOnly member of the s_UseTool structure. It appears to be non-functional unless I'm missing something in the code below:


#include "sierrachart.h"

SCDLLName("Outline Test")

SCSFExport scsf_Outline_Test(SCStudyInterfaceRef sc)
{
  sc.GraphName = "Outline Test";

  if (sc.SetDefaults)
{
    sc.StudyDescription = "Test of sc.DrawOutline";
    sc.GraphRegion = 0;
    sc.FreeDLL = 0; //TODO CHANGE TO 0 BEFORE RELEASE
  }

  if (sc.Index == (sc.ArraySize - 1))
  {
        s_UseTool FilledRectangle;
        FilledRectangle.Clear();
        FilledRectangle.ChartNumber = sc.ChartNumber;
        FilledRectangle.Region = sc.GraphRegion;
        FilledRectangle.AddMethod = UTAM_ADD_ALWAYS;
        FilledRectangle.DrawingType = DRAWING_RECTANGLEHIGHLIGHT;
        FilledRectangle.BeginIndex = sc.Index - 5;
        FilledRectangle.EndIndex = sc.Index - 2;
        FilledRectangle.BeginValue = sc.High[sc.Index - 2] + 1;
        FilledRectangle.EndValue = sc.High[sc.Index - 2] + 2;
        FilledRectangle.Color = RGB(255,0,0);
        FilledRectangle.SecondaryColor = RGB(255,0,0);
        FilledRectangle.TransparencyLevel = 0;
        FilledRectangle.LineWidth = 2;
        FilledRectangle.DrawOutlineOnly = 0;

        sc.UseTool(FilledRectangle);

        s_UseTool OutlineRectangle1;
        OutlineRectangle1.Clear();
        OutlineRectangle1.ChartNumber = sc.ChartNumber;
        OutlineRectangle1.Region = sc.GraphRegion;
        OutlineRectangle1.AddMethod = UTAM_ADD_ALWAYS;
        OutlineRectangle1.DrawingType = DRAWING_RECTANGLEHIGHLIGHT;
        OutlineRectangle1.BeginIndex = sc.Index - 5;
        OutlineRectangle1.EndIndex = sc.Index - 2;
        OutlineRectangle1.BeginValue = sc.Low[sc.Index - 2] - 1;
        OutlineRectangle1.EndValue = sc.Low[sc.Index - 2] - 2;
        OutlineRectangle1.Color = RGB(255,0,0);
        OutlineRectangle1.SecondaryColor = RGB(255,0,0);
        OutlineRectangle1.TransparencyLevel = 0;
        OutlineRectangle1.LineWidth = 2;
        OutlineRectangle1.DrawOutlineOnly = 1;

        sc.UseTool(OutlineRectangle1);

        s_UseTool OutlineRectangle2;
        OutlineRectangle2.Clear();
        OutlineRectangle2.ChartNumber = sc.ChartNumber;
        OutlineRectangle2.Region = sc.GraphRegion;
        OutlineRectangle2.AddMethod = UTAM_ADD_ALWAYS;
        OutlineRectangle2.DrawingType = DRAWING_RECTANGLEHIGHLIGHT;
        OutlineRectangle2.BeginIndex = sc.Index - 5;
        OutlineRectangle2.EndIndex = sc.Index - 2;
        OutlineRectangle2.BeginValue = sc.Low[sc.Index - 2] - 2;
        OutlineRectangle2.EndValue = sc.Low[sc.Index - 2] - 3;
        OutlineRectangle2.Color = RGB(255,0,0);
        //OutlineRectangle.SecondaryColor = RGB(255,0,0);
        OutlineRectangle2.TransparencyLevel = 0;
        OutlineRectangle2.LineWidth = 2;
        OutlineRectangle2.DrawOutlineOnly = 1;

        sc.UseTool(OutlineRectangle2);

        s_UseTool OutlineRectangle3;
        OutlineRectangle3.Clear();
        OutlineRectangle3.ChartNumber = sc.ChartNumber;
        OutlineRectangle3.Region = sc.GraphRegion;
        OutlineRectangle3.AddMethod = UTAM_ADD_ALWAYS;
        OutlineRectangle3.DrawingType = DRAWING_RECTANGLEHIGHLIGHT;
        OutlineRectangle3.BeginIndex = sc.Index - 5;
        OutlineRectangle3.EndIndex = sc.Index - 2;
        OutlineRectangle3.BeginValue = sc.Low[sc.Index - 2] - 3;
        OutlineRectangle3.EndValue = sc.Low[sc.Index - 2] - 4;
        OutlineRectangle3.Color = RGB(255,0,0);
        //OutlineRectangle.SecondaryColor = RGB(255,0,0);
        OutlineRectangle3.TransparencyLevel = 100;
        OutlineRectangle3.LineWidth = 2;
        OutlineRectangle3.DrawOutlineOnly = 1;

        sc.UseTool(OutlineRectangle3);
  }
  return;
}

The first rectangle is filled as expected.
The second rectangle I would expect to be only an outline as DrawOutlineOnly = 1, but it is filled with the SecondaryColor value.
The third rectangle is a test to see whetner the SecondaryColor value was the problem but it is not the case. Null value for SecondaryColor fills with black.
The fourth rectangle is an outline but this is because of TransparencyLevel = 100. I am cautious of this parameter because of possible effects on performance.

Am I missing something here or is DrawOutlineOnly non-functional currently?

Thx
Lee.