Copyright © 2006-2011 MultiMedia Soft

WaveformAnalyzer.BitmapViewDrawToHdc method

Previous pageReturn to chapter overviewNext page

Remarks

 

Creates a graphic file containing the bitmap view of the analysed sound waveform: the view can represent the full sound's waveform or portions of it.

Before calling this method it's mandatory performing a previous sound's analysis through a call to the WaveformAnalyzer.AnalyzeFullSound method and waiting its completion through the WaveAnalysisDone event.

 

For details about generating a waveform bitmap of the recorded sound and about the use of the Waveform Analyzer refer to the How to use the Waveform Analyzer section.

For further details about methods of the Waveform Analyzer refer to the WaveformAnalyzer class section.

 

 

Syntax

 

[Visual Basic]

Public Function BitmapViewDrawToHdc (

hDC as IntPtr,

nPosLeft as Int32,

nPosTop as Int32,

nWidth as Int32,

nHeight as Int32,

nWaveformStereoMode as enumWaveformStereoModes,

bUseHalfColorsForPeaks as Boolean,

bShowVerticalLines as Boolean,

nStartPos as Int32,

nEndPos as Int32

) as enumErrorCodes


 

[C#]

public enumErrorCodes BitmapViewDrawToHdc (

IntPtr hDC,

Int32 nPosLeft,

Int32 nPosTop,

Int32 nWidth,

Int32 nHeight,

enumWaveformStereoModes nWaveformStereoMode,

bool bUseHalfColorsForPeaks,

bool bShowVerticalLines,

Int32 nStartPos,

Int32 nEndPos

);


 

[C++]

public: enumErrorCodes BitmapViewDrawToHdc (

IntPtr hDC,

Int32 nPosLeft,

Int32 nPosTop,

Int32 nWidth,

Int32 nHeight,

enumWaveformStereoModes nWaveformStereoMode,

bool bUseHalfColorsForPeaks,

bool bShowVerticalLines,

Int32 nStartPos,

Int32 nEndPos

);


 

 

Parameter

Description

 

 

hDC

Handle to the output graphical Device Context

nPosLeft

Horizontal left position, expressed in pixels, of the destination rectangle where the bitmap will be rendered on the Device Context

nPosTop

Vertical top position, expressed in pixels, of the destination rectangle where the bitmap will be rendered on the Device Context

nWidth

Width, expressed in pixels, of the destination rectangle on the Device Context

nHeight

Height, expressed in pixels, of the destination rectangle on the Device Context

nWaveformStereoMode

Visualization mode used for displaying stereo sounds

Supported values are the following:

Mnemonic constant

Value

Meaning

STEREO_MODE_CHANNELS_BOTH

0

Right and left channels are displayed separately on two different panes as seen on the pictures A and B above.

STEREO_MODE_CHANNELS_LEFT

1

Only the left channel content is displayed on a single pane

STEREO_MODE_CHANNELS_RIGHT

2

Only the right channel content is displayed on a single pane

STEREO_MODE_CHANNELS_MIXED

3

Right and left channels contents are mixed together and displayed on a single pane

bUseHalfColorsForPeaks

Boolean value that determines if waveform peaks will have a half intensity color.

Supported values are the following:

Mnemonic constant

Meaning

false

Doesn't use half color for peaks

true (default)

Uses half color for peaks

bShowVerticalLines

Boolean value that determines if eventual vertical lines, added through previous calls to the WaveformAnalyzer.BitmapViewVerticalLineAdd method, should be rendered as well.

Supported values are the following:

Mnemonic constant

Meaning

false

Doesn't render vertical lines

true (default)

Renders vertical lines

nStartPos

Number representing the sound's position, expressed in milliseconds, where the waveform visualization begins.

The value 0 represents the sound's beginning.

nEndPos

Number representing the sound's position, expressed in milliseconds, where the waveform visualization ends.

The value -1 represents the sound's end.

 

 

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