Copyright © 2005-2018 MultiMedia Soft

Spectrum class

Previous pageReturn to chapter overviewNext page

The Spectrum class, accessible through the control's DisplaySpectrum property, contains information needed to render the embedded Spectrum visual feedback.

 

It can be used at Run-time in order to create the embedded Spectrum and to change its graphic settings. For details about using Visual Feedbacks refer to the How to use the embedded Visual Feedbacks section

 

The Spectrum class is implemented through the following methods and properties:

 

Methods

 

Create

CreateNew

GetTable

Resize

SetNumberOfBands

SetHwnd

SetBackPictureFromFile

SetBackPictureFromHandle

Show

 

Properties

 

BandsWidth

ColorBands

ColorPeaks

ColorBackground

HasPeaks

UseLogarithmic

ZoomPerc

 

The following code snippets show how to create and change this object in your code. These examples assume that you have placed a control named audioDjStudio1 on a form or dialog and that you want to change a couple of graphic settings (Bands and Background colors).

 

Visual Basic.NET

 

Here follows the code needed to perform the requested operations

 

' create the spectrum on player 0 over an existing control

AudioDjStudio1.DisplaySpectrum.Create(0, PictureBox1.Handle)

 

' set the blue color for spectrum bands of player 0

AudioDjStudio1.DisplaySpectrum.set_ColorBands(0, Color.Blue)

 

' set the white color for spectrum background of player 0

AudioDjStudio1.DisplaySpectrum.set_ColorBackground(0, Color.White)

 

Visual C#.NET

 

Here follows the code needed to perform the requested operations

 

// create the spectrum on player 0 over an existing control

audioDjStudio1.DisplaySpectrum.Create(0, pictureBox1.Handle);

 

// set the blue color for spectrum bands of player 0

audioDjStudio1.DisplaySpectrum.set_ColorBands (0, Color.Blue);

 

// set the white color for spectrum background of player 0

audioDjStudio1.DisplaySpectrum.set_ColorBackground(0, Color.White);