Xojo.Core.MemoryBlock.Constructor(other As MemoryBlock)

From Xojo Documentation

Constructor

Creates a new MemoryBlock with the data from an existing MemoryBlock.

Sample Code

Load image data into a MemoryBlock and then use that data to construct the image later:

Var f As Xojo.IO.FolderItem = Xojo.IO.SpecialFolder.GetResource("MyImage.JPG")

Var b As Xojo.IO.BinaryStream
b = Xojo.IO.BinaryStream.Open(f, BinaryStream.LockModes.Read)

Var mb As New Xojo.Core.MemoryBlock(b.Read(b.Length))

b.Close

Var image As iOSImage
image = iOSImage.FromData(mb)

ImageView1.Image = image