PDA

View Full Version : Functions from System.Drawing namespace


JangoFolly
04-15-2008, 01:08 PM
The Custom Drawing section of the Help Guide (under Shared Draw Methods and Properties) states the following:

There are virtually no limits for custom drawing on a chart panel. Since NinjaScript is based on Microsoft C#, the entire System.Drawing namespace is available for use. Custom drawing is an advanced programming topic and should only be considered by programmers familiar with Microsoft C# and the .NET Framework.

I would like to draw variable-width rectangles on my charts, but the drawing functions described in the help guide don't seem to have a property by which to scale the size of the object that is drawn.

Can you please point me in the right direction with C#/.NET for calling a drawing function that will basically operate the same as the DrawSquare function, but which will allow me to control the width by way of a variable reference? I looked through the System.Drawing documentation on the MSDN website, but I don't even know where to begin in terms of identifying a specific function to call.

Thank you.


Regards,

NinjaTrader_Dierk
04-15-2008, 01:17 PM
Unfortunately this is beyond what we provide support for.

I suggest taking a look at CustomPlotSample indicator and take it from there.

Elliott Wave
04-15-2008, 01:55 PM
Try graphics.DrawRectangle

http://shup.com/Shup/36431/rectangle.jpg

JangoFolly
04-15-2008, 02:03 PM
Try graphics.DrawRectangle

http://shup.com/Shup/36431/rectangle.jpg

Many thanks, EW. I overlooked that function thinking it worked the same way as DrawDot and DrawSquare (i.e., non-scalable).


Regards,