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

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!


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))


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

ImageView1.Image = image