Picture or memoryblock to binarystream

Hello,
how can i convert a picture object to a binaryStream?

Thanks Marco

https://documentation.xojo.com/index.php/Picture.GetData

http://documentation.xojo.com/index.php/BinaryStream

so, convert it into a memory block and then to binary stream?

mb=p.GetData(Picture.FormatJPEG,Picture.Qualitymin)
Binarydata=new BinaryStream(mb)

which is faster, convert a picture into a string or into memory block/binarystream for sending?

Sending where?
What do you want to actually do?

yes sorry i forget to mention, i send this data over tcpSocket…

Look on the help page for Memoryblock. There’s an example of creating a Memoryblock and accessing it with a BinaryStream.

http://developer.xojo.com/MemoryBlock