Copyright © 2008-2013 MultiMedia Soft

BitmapViewSaveToFile 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 AnalyzeSoundFromFile or AnalyzeSoundFromFileRaw methods and waiting its completion through the WaveAnalysisDone event.

 

 

Syntax

 

[Visual Basic]

Public Function BitmapViewSaveToFile (

nStartPos as Int32,

nEndPos as Int32,

nBitmapWidth as Int32,

nBitmapHeight as Int32,

nWaveformType as enumWaveformTypes,

strPathname as string,

nFormat as enumGraphicFormats,

nFormatParameter as Int32

) as enumWanErrorCodes


 

[C#]

public enumWanErrorCodes BitmapViewSaveToFile (

Int32 nStartPos,

Int32 nEndPos,

Int32 nBitmapWidth,

Int32 nBitmapHeight,

enumWaveformTypes nWaveformType,

string strPathname,

enumGraphicFormats nFormat,

Int32 nFormatParameter

);


 

[C++]

public: enumWanErrorCodes BitmapViewSaveToFile (

Int32 nStartPos,

Int32 nEndPos,

Int32 nBitmapWidth,

Int32 nBitmapHeight,

enumWaveformTypes nWaveformType,

string strPathname,

enumGraphicFormats nFormat,

Int32 nFormatParameter

);


 

 

Parameter

Description

 

 

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.

nBitmapWidth

Number representing the generated bitmap width, expressed in pixels. A value of -1 indicates no width constraints: in this case the control will generate a bitmap large enough in order to contain the full sound's waveform.

nBitmapHeight

Number representing the generated bitmap height, expressed in pixels.

nWaveformType

The type of rendered waveform, related to the sound's channels.

Supported values are the following:

Mnemonic value

Value

Meaning

WAVEFORM_TYPE_LEFT

0

The bitmap contains sound data for the left channel

WAVEFORM_TYPE_RIGHT

1

The bitmap contains sound data for the right channel

WAVEFORM_TYPE_MIXED

2

The bitmap contains sound data for left and right mixed channels

strPathname

String containing the absolute pathname of the BMP file where the waveform will be saved. If this pathname should contain invalid characters, they would be automatically changed into an underscore '_' character.

nFormat

Graphic format used to save the bitmap.

Supported values are the following:

Mnemonic value

Value

Meaning

GRAPHIC_FORMAT_BMP

0

BMP format

GRAPHIC_FORMAT_JPEG

1

JPEG format

GRAPHIC_FORMAT_PNG

2

PNG format

GRAPHIC_FORMAT_GIF

3

GIF format

GRAPHIC_FORMAT_TIFF

4

TIFF format

nFormatParameter

Eventual parameters required by the chosen graphic format.

 

When the nFormat parameter is set to GRAPHIC_FORMAT_JPEG, this parameter defines the JPEG compression factor whose range can be in the range from 0 (Maximum compression, Lower Quality) to 100 (Minimum compression, Higher Quality).

 

 

Return value

 

Value

Meaning

 

 

Negative value

An error occurred (see the LastError property for further error details)

enumWanErrorCodes.ERR_WAN_NOERROR (0)

The method call was successful