API Documentation -> NtCustomObjectPaint -> NtCreateDisplayObject

# NtCustomObjectPaint.NtCreateDisplayObject Method

The data objects in a NtTimeChartControl are not directly used for drawing. Instead for each data object that resides on the NtTimeChartControl's sheet (and thereby is visible or can become visible by scrolling) a NtDisplayObject is created which is then used to draw the item.
For custom drawing the NtTimeChartControl does not know how to create a NtDisplayObject. So it calls this interface method to let the application do it.

Example:
If drawing your customized Display Objects is really easy (for example just a circle with fixed radius on the time stamp of the Data Object) then there is no need to create your own derived class of NtDisplayObject. Instead it is fine to use NtDisplayObject just as it is so your implementation of this interface member simply looks like this:

public NtDisplayObject NtCreateDisplayObject(NtTimeChartControl ntTimeChartControl, NtDataObject dataObject, NtDisplayDef displayDef, Graphics g)
{
return new NtDisplayObject();
}

Overload List:

Modifier / Return Value | Name and Parameters | Description
--- | --- | ---
NtDisplayObject | NtCreateDisplayObject ( NtTimeChartControl ntTimeChartControl, NtDataObject dataObject, NtDisplayDef displayDef, Graphics g ) | Implement this interface method to create a display object for the data object given.

Return value:

NtDisplayObject

Parameters:

NtTimeChartControl ntTimeChartControl
The NtTimeChartControl that does the call. Normally not used if you have only one NtTimeChartControl in your Form or application. But if you have more than one NtTimeChartControl and implement this interface only once, this parameter might be helpful.

NtDataObject dataObject
The data object to create a NtDisplayObject for.

NtDisplayDef displayDef
The NtDisplayDef that defines certain parameters for drawing this object: Colors, preferred row height etc. If you prefer an unconfigurable constant way of drawing the objects you can ignore this parameter.

Graphics g
The Graphics object of the NtTimeChartControl. This can be helpful for calculating text boundaries and sizes so you do not need to create a Graphics object by yourself (which would be slow).

Remarks:

None.

Top API Documentation -> NtTimeChartControl -> NtCreateDisplayObject © 2016 Bassaly