Copyright © 2008-2018 MultiMedia Soft

TagsEditor.FLAC_PictureFrameMemoryFileGet method

Previous pageReturn to chapter overviewNext page



Obtains a copy in memory of the picture file stored inside a FLAC picture frame.


For further details about methods related to tags editing refer to the TagsEditorMan class.

For details about the editing of tags see the How to edit tag info in sound files tutorial.





[Visual Basic]

Public Function FLAC_PictureFrameMemoryFileGet (

nIndex as Int32,

pBuffer() as Byte,

nBufferLength as Int32

) as enumErrorCodes



public string FLAC_PictureFrameMemoryFileGet (

Int32 nIndex,

byte[] pBuffer,

Int32 nBufferLength




public: string FLAC_PictureFrameMemoryFileGet (

Int32 nIndex,

unsigned char __gc[] pBuffer,

Int32 nBufferLength








Zero-based index of the picture frame. The total number of picture frames available inside the FLAC tag can be obtained through a call to the TagsEditor.FLAC_PictureFrameCountGet method.


Output buffer that, on return from the method call, will contain the picture file data


Length of the buffer expressed in bytes



Return value






Negative value

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

enumErrorCodes.ERR_NOERROR (0)

The method call was successful.



Below you can find a couple of samples that demonstrate how to retrieve a picture and store it inside a memory buffer in Visual Basic.NET and Visual C#:


Visual Basic.NET


Private Sub buttonGetPicture_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles buttonGetPicture.Click


' get the size of the picture in bytes

Dim nSizeInBytes As Int32

AudioSoundEditor1.TagsEditor.FLAC_PictureFrameSizeGet (0, nSizeInBytes)

if nSizeInBytes = 0 then Exit Sub


' allocate the receiving buffer

Dim byteBuffer As Byte() = Nothing

byteBuffer = New Byte(nSizeInBytes)


' read picture data

AudioSoundEditor1.TagsEditor.FLAC_PictureFrameMemoryFileGet (0, byteBuffer, nSizeInBytes)



use the buffer





Visual C#


private void buttonGetPicture_Click(object sender, System.EventArgs e)


// get the size of the picture in bytes

Int32 nSizeInBytes = 0;

AudioSoundEditor1.TagsEditor.FLAC_PictureFrameSizeGet (0, ref nSizeInBytes);

if (nSizeInBytes == 0)



// allocate the receiving buffer

byte[] byteBuffer = new byte[nSizeInBytes];


// read picture data

AudioSoundEditor1.TagsEditor.FLAC_PictureFrameMemoryFileGet (0, byteBuffer, nSizeInBytes);



use the buffer