Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 02:42:44 +0000



Post From: OpenGL support for custom drawings

[2023-10-04 09:09:56]
Sierra_Chart Engineering - Posts: 17190
This is how to do it:

  // Yellow brush
  n_ACSIL::s_GraphicsBrush GraphicsBrush;
  GraphicsBrush.m_BrushType = n_ACSIL::s_GraphicsBrush::BRUSH_TYPE_SOLID;
  GraphicsBrush.m_BrushColor.SetRGB(255, 255, 0);

  sc.Graphics.SetBrush(GraphicsBrush);

  n_ACSIL::s_GraphicsPen GraphicsPenForRectangle;
  GraphicsPenForRectangle.m_PenColor.SetColorValue(COLOR_BLUE);
  GraphicsPenForRectangle.m_PenStyle = n_ACSIL::s_GraphicsPen::e_PenStyle::PEN_STYLE_SOLID;
  GraphicsPenForRectangle.m_Width = 5;

  sc.Graphics.SetPen(GraphicsPenForRectangle);

  //Draw a rectangle at the top left of the chart
  sc.Graphics.DrawRectangle( sc.StudyRegionLeftCoordinate + 5, sc.StudyRegionTopCoordinate + 5, sc.StudyRegionLeftCoordinate + 200, sc.StudyRegionTopCoordinate + 200);


  // Hollow Rectangle

  sc.Graphics.ResetBrush();

  n_ACSIL::s_GraphicsBrush HollowBrush;
  HollowBrush.m_BrushType = n_ACSIL::s_GraphicsBrush::BRUSH_TYPE_STOCK;
  HollowBrush.m_BrushStockType = NULL_BRUSH;

  sc.Graphics.SetBrush(HollowBrush);

  //Using existing set pen

  sc.Graphics.DrawRectangle(sc.StudyRegionLeftCoordinate + 300, sc.StudyRegionTopCoordinate + 300, sc.StudyRegionLeftCoordinate + 500, sc.StudyRegionTopCoordinate + 500);

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
Date Time Of Last Edit: 2023-10-04 09:18:31