Copyright © 2005-2019 MultiMedia Soft

Spectrum.Create method

Previous pageReturn to chapter overviewNext page

Remarks

 

Creates the Spectrum object: once created, the Spectrum will stay active until the termination of the container application: being a graphical object, the Spectrum needs to be associated to an existing window that will be used as a surface for the graphic rendering: this window can be changed at a later time through the Spectrum.SetHwnd method. For development environments like WPF, where controls don't expose a HWND, the usage of the Spectrum.CreateNew method should be preferred.

 

Once created, by default the Spectrum is still not visible: you must make a call to the Spectrum.Show method in order to display it.

 

Note that you can have a different Spectrum for each of the allocated players.

 

For further details about using the embedded Spectrum refer to the Spectrum class section.

For details about using Visual Feedbacks refer to the How to use the embedded Visual Feedbacks section.

 

 

Syntax

 

[Visual Basic]

Public Function Create (

nPlayerIndex as Int16,

hWndTarget as IntPtr

) as enumErrorCodes


 

[C#]

public enumErrorCodes Create (

Int16 nPlayerIndex,

IntPtr hWndTarget

);


 

[C++]

public: enumErrorCodes Create (

Int16 nPlayerIndex,

IntPtr hWndTarget

);


 

 

Parameter

Description

 

 

nPlayerIndex

Number representing the zero-based index of the player that will use the Spectrum

hWndTarget

Handle of the window whose surface will be used in order to render the Spectrum graphics.

If this parameter is set to NULL or 0, no graphical representation will be performed but you will have the opportunity to be notified about spectrum values change through the CallbackForPlayersEvents delegate having the nEvent parameter set to EV_SPECTRUM_CHANGE, allowing to render your custom spectrum graphics after calling the Spectrum.GetTable method.

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred (see the LastError property for further error details)

enumErrorCodes.NOERROR (0)

The method call was successful.