BASS.NET API for the Un4seen BASS Audio Library

VisualsCreateSpectrum Method (Int32, Int32, Int32, Color, Color, Color, Boolean, Boolean, Boolean)

BASS.NET API for the Un4seen BASS Audio Library
Creates a bitmap representing a FFT spectrum graph.

Namespace:  Un4seen.Bass.Misc
Assembly:  Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax

public Bitmap CreateSpectrum(
	int channel,
	int width,
	int height,
	Color color1,
	Color color2,
	Color background,
	bool linear,
	bool fullSpectrum,
	bool highQuality
)

Parameters

channel
Type: SystemInt32
The channel for which to create the spectrum graph.
width
Type: SystemInt32
The width (in pixel) of the image to create.
height
Type: SystemInt32
The height (in pixel) of the image to create.
color1
Type: System.DrawingColor
The base color (normal) for the FFT data.
color2
Type: System.DrawingColor
The peak color for the FFT data.
background
Type: System.DrawingColor
The background color to be used when drawing the image.
linear
Type: SystemBoolean
, if linear scaling (see ScaleFactorLinear) should be applied to the FFT data. , to scale by Sqr (see ScaleFactorSqr) to make low values more visible (recommended).
fullSpectrum
Type: SystemBoolean
, if the full frequency spectrum should be shown (across the whole width of the image). , if the width of the image should be use (in this case as much frequencies are shown - starting with the lower values - as fit into the width).
highQuality
Type: SystemBoolean
, if anti alias should be used when drawing. will draw in high speed mode.

Return Value

Type: Bitmap
The created bitmap image representing the spectrum.
Examples

Using the following code in a timer routine (e.g. updated every 50ms):
this.pictureBoxSpectrum.Image = Un4seen.Bass.Misc.Visuals.CreateSpectrum(_stream, 
                                  this.pictureBoxSpectrum.Width, 
                                  this.pictureBoxSpectrum.Height, 
                                  Color.Lime, Color.Red, Color.Black, 
                                  false, false, false);
See Also

Reference