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:

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

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

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

b.Close

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

ImageView1.Image = image