Bitmap to Stream

AnyBitmap generated from a program or opened from a file directory in users computer can be converted to a memory stream to be used further in the program without the need to create a temporary buffers and files in an application. In this code example, we provide a simple way on how to get stream and also converting AnyBitmap file loaded from local directory to memory stream.

Get Stream

This function is used to get the stream from a particular AnyBitmap file. Simply assign a MemoryStream variable to store the memory stream from an AnyBitmap file obtained using .GetStream() method.

To Stream

This function is used to convert AnyBitmap file to a memory stream. Simply assign a MemoryStream variable to store the value of AnyBitmap file converted to memory stream using .ToStream() method.