Picture.FromData

From Xojo Documentation

Shared Method

Picture.FromData(data As MemoryBlock) As Picture

Supported for all project types and targets.

Obtains a picture that is stored in a MemoryBlock and returns a Picture.

Example

This example uses GetData to convert an image in an ImageWell into a MemoryBlock and then uses FromData to display the image:

Var mb As MemoryBlock
If productImageWell.Image <> Nil Then
// Get the image data
mb = ProductImageWell.Image.GetData(Picture.FormatJPEG, Picture.QualityHigh)
// convert the memoryblock back into an image
Imagewell2.Image = Picture.FromData(mb)
End If