API Documentation -> NtCustomObjectPaint

# NtCustomObjectPaint Interface

The NtDisplayDef defines via its member displayMethod how a certain type of data is to be drawn by the NtTimeChartControl. If displayMethod ranges from 0 to 4 the NtTimeChartControl knows how to create the NtDisplayObject and also how to draw it. In contrast to that a displayMethod greater than 100 indicates that the object shall be drawn by your application's code. In this case the NtTimeChartControl calls your implementation of the NtCustomObjectPaint interface so your code does the drawing and the necessary calculations.
You should implement the interface members according to the appearance you want your custom objects to have.
If you do not use custom drawing you do not need to implement this interface. In this case all NtDisplayDefs you provide should have thier displayMethod between 0 and 4.
The process of implementing custom drawn objects is described in the tutorial Custom Object Drawing.

Interface Methods:

Modifier / Return Value | Name and Parameters | Description
--- | --- | ---
NtDisplayObject | NtCreateDisplayObject ( NtTimeChartControl ntTimeChartControl, NtDataObject dataObject, NtDisplayDef displayDef, Graphics g ) | When the data object is moved into the visible range so it is located on the current sheet of the NtTimeChartControl then a NtDisplayObject has to be created for it. Then this method is called.
void | NtPaintCustomObject ( NtTimeChartControl ntTimeChartControl, NtDisplayObject displayObject, Rectangle objectRect, Rectangle paintRect, Graphics g ) | This method is called to actually paint the object using the Graphics object g. Along with that the implementing method receives the objectRectangle which is the rectangle to draw into (in ClientRect coordinates of the NtTimeChartControl), and the paintRect which basically is the same as the v only that it is reduced for clipping already. Finally the NtDisplayObject is also shipped. It includes the NtDataObject so all information for drawing is at hand.
void | NtCalculateLeftAndRightEdgesTicks ( NtTimeChartControl ntTimeChartControl, NtDataObject dataObject, NtDisplayDef displayDef, double ticksPerPixel, out long leftTicks, out long rightTicks ) | For its internal algorithms the NtTimeChartControl needs to be able to calculate the timestamp of the left and the right edge of the NtDisplayObject's rectangle. At any time the implementation of this interface method should be able to return these two values for any given NtDataObject. To enable the method to fulfill this task, the ticks per pixel for the time scale in question is given as a parameter.
void | NtCalculateLeftAndRightEdgesInSheet ( NtTimeChartControl ntTimeChartControl, NtDisplayObject displayObject, long sheetLeftTicks, double pixelsPerTick, out long left, out long right ) | Every display ojbect has a bounding rectangle. When implementing this method, you should calculate the left and the right of this bounding rectangle of your display object in sheet coordingates. To enable this, the left edge of the sheet in ticks is given as well as the factor pixelsPerTick.
void | NtCalculateTopAndBottomInRow ( NtTimeChartControl ntTimeChartControl, NtDisplayObject displayObject, out int top, out int bottom ) | The vertical bounderies of the display object relative to the row top. Typical values for example for text objects are a top of 2 and an according bottom depending on the font size. In these cases these parameters are quite fix. Only if objects are of different vertical position within the row (like in case of courves) you will have to calculate per object in dependecy of the value.

Top API Documentation -> NtCustomObjectPaint © 2016 Bassaly