Marblecore Imaging Library Documentation

Documentation Introduction
Documentation / Marblecore Imaging / Methods / Deserialize

Deserialize method

Deserializes a memory stream to the bitmap. If no image is currently loaded, a new image is created. You have to supply a stream which is created using the Serialize method. If you want to load a normal image from a stream, use the LoadFromStream method instead.

Syntax

Boolean Deserialize(pStream As Stream)

Return value

Returns true if the function succeeded.

Parameters

ParameterTypeRequiredDescription
pStreamStreamYesPointer to the stream.

Example

The Deserialize method can be used to create a quick copy of an image object to another image object. In the example below we use this method to create a copy of the first image object to the second object.
 
1 // Create the first image and draw a red rectangle on it
2 Imaging1.Create(200, 200);
3 Imaging1.DrawRectangleFilled(0, 0, 200, 200, Imaging1.GetColorFromHTML("#ff0000"));
4 
5 // Create a copy of the image in Imaging1 to Imaging2
6 Imaging2.Deserialize(Imaging1.Serialize());

Category

Basic operations

See also

Create | LoadFromBase64 | LoadFromFile | LoadFromSerializedStream | LoadFromStream | LoadFromURL | Reset | SaveToBase64 | SaveToFile | SaveToHBitmap | SaveToHBitmapPreMultiplied | SaveToStream | Serialize | Working with streams