JVCL Help:TJvID3BinaryFrame.SaveToStream

From Project JEDI Wiki
Jump to navigationJump to search
JEDI Visual Component Library Help

Search in JVCL Help

 
Search in all projects
 

Summary

Writes the entire contents of the memory stream to the stream object specified by Stream.


Pascal

 procedureSaveToStream(Stream: TStream); virtual;


Parameters

Parameters Description
Stream: TStream Specifies the name of the stream to which the binary field’s value is saved.


Description

Use SaveToStream to copy the contents of the binary field of the tag into another storage medium. SaveToStream writes the entire contents into the indicated stream object, starting at the current position in the stream that was passed as a parameter.
If the entire contents of the memory stream cannot be written to the target stream, SaveToStream raises an exception.
Example: var

 MS: TMemoryStream;
Frame: TJvID3BinaryFrame;
begin
Frame := TJvID3BinaryFrame.Find(JvID3v21, fiPicture);
if (Frame isTJvID3PictureFrame) and
SameText(TJvID3PictureFrame(Frame).MIMEType, 'image/bmp') then
begin
MS := TMemoryStream.Create;
try
Frame.SaveToStream(MS);
Image1.Picture.Bitmap.LoadFromStream(MS);
finally
MS.Free;
end;
end;
end;
Note that you can rewrite this example as { If Find results nil then the picture is cleared }
Image1.Picture.Assign(TJvID3BinaryFrame.Find(JvID3v21, fiPicture));


See Also

TJvID3BinaryFrame.SaveToFile


About

Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page