Remarks
Renders the bitmap view of the given waveform range inside a graphical Device Context (HDC).
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 object section.
Syntax
[C++]
short control.WaveformAnalyzer.SnapshotViewDrawToHdc (
short nMode,
OLE_HANDLE hDC,
long nPosLeft,
long nPosTop,
long nWidth,
long nHeight,
short nChannel,
short bShowMaskedGraphicItems,
long nStartPos,
long 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:
|
nStartPos
|
Number representing the sound's position, expressed in milliseconds, where the waveform visualization begins.
The value 0 represents the sound's beginning.
This position can assume negative values as well; if for example you should need to display a 10 seconds range (10000 milliseconds), with the beginning of the sound on the center of the device context, you could set this value to -5000 and the nEndPos parameter to 5000; in this case position 0 of the sound would be rendered exactly on the center of the device context.
On the screenshots below you can see two portions of the same sound; in the first case the vertical white line represents the position 0 ms of the song ranging from -5000 ms to +5000 ms; as you can see, the negative portion on the left, where no sound exists, is rendered as absence of audible sound.
In this seconds case the vertical white line represents the position 5000 ms of the song ranging from 0 ms to +10000 ms
|
nEndPos
|
Number representing the sound's position, expressed in milliseconds, where the waveform visualization ends.
The value -1 represents the sound's end.
This position can assume values higher respect the effective sound duration; for portions of sounds outside of the effective duration, the waveform is rendered as absence of audible sound as seen above for the nStartPos parameter when rendering negative positions.
|
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
|
|