Copyright © 2011-2019 MultiMedia Soft

WaveformAnalyzer.SnapshotViewDrawToHdc 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.

 

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 SnapshotViewDrawToHdc (

nMode as enumWaveSnapshotViewMode,

hDC as IntPtr,

nPosLeft as Int32,

nPosTop as Int32,

nWidth as Int32,

nHeight as Int32,

nChannel as enumWaveformChannels,

bShowMaskedGraphicItems as Boolean,

nStartPos as Int32,

nEndPos as Int32

) as enumErrorCodes


 

[C#]

public enumErrorCodes SnapshotViewDrawToHdc (

enumWaveSnapshotViewMode nMode,

IntPtr hDC,

Int32 nPosLeft,

Int32 nPosTop,

Int32 nWidth,

Int32 nHeight,

enumWaveformChannels nChannel

bool bShowMaskedGraphicItems,

Int32 nStartPos,

Int32 nEndPos

);


 

[C++]

public: enumErrorCodes SnapshotViewDrawToHdc (

enumWaveSnapshotViewMode nMode,

IntPtr hDC,

Int32 nPosLeft,

Int32 nPosTop,

Int32 nWidth,

Int32 nHeight,

enumWaveformChannels nChannel

bool bShowMaskedGraphicItems,

Int32 nStartPos,

Int32 nEndPos

);


 

 

Parameter

Description

 

 

nMode

Snapshot view mode.

Supported values are the following:

Mnemonic value

Value

Meaning

WAVE_SNAPSHOT_MODE_WAVEFORM

0

Snapshot of the waveform

WAVE_SNAPSHOT_MODE_SPECTRAL

1

Snapshot of the spectral view

WAVE_SNAPSHOT_MODE_WAVEFORM_ABS

2

Snapshot of the waveform with absolute values

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

nChannel

Audio channel to render.

Supported values are the following:

Mnemonic value

Value

Meaning

WAVEFORM_CHAN_ALL

-2

The snapshot contains sound data for all channels separated

WAVEFORM_CHAN_MIXED

-1

The snapshot contains sound data for all channels mixed together

WAVEFORM_CHAN_0

0

The snapshot contains sound data for channel 0 or left channel for stereo

WAVEFORM_CHAN_1

1

The snapshot contains sound data for channel 1 or right channel for stereo

WAVEFORM_CHAN_2

2

The snapshot contains sound data for channel 2

WAVEFORM_CHAN_3

3

The snapshot contains sound data for channel 3

WAVEFORM_CHAN_4

4

The snapshot contains sound data for channel 4

WAVEFORM_CHAN_5

5

The snapshot contains sound data for channel 5

WAVEFORM_CHAN_6

6

The snapshot contains sound data for channel 6

WAVEFORM_CHAN_7

7

The snapshot contains sound data for channel 7

bShowMaskedGraphicItems

Boolean flag that determines if eventual graphic items, enabled/disabled through the WaveformAnalyzer.SnapshotViewGraphicItemsMaskSet method, should be rendered over the waveform.

Supported values are the following:

Mnemonic constant

Meaning

false

Doesn't render graphic items

true

Renders graphic items. See the How to add graphic items to the Waveform analyzer tutorial for details about graphic items management on the waveform analyzer.

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.ERR_NOERROR (0)

The method call was successful