BitmapDataExtensionsSave Method

Saves the content of this bitmapData into the specified stream.

Definition

Namespace: KGySoft.Drawing.Imaging
Assembly: KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 8.2.0
C#
public static void Save(
	this IReadableBitmapData bitmapData,
	Stream stream
)

Parameters

bitmapData  IReadableBitmapData
The IReadableBitmapData to save.
stream  Stream
The stream to save the bitmap data into.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IReadableBitmapData. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

  Note

This method blocks the caller, and does not support cancellation or reporting progress. Use the BeginSave or SaveAsync (in .NET Framework 4.0 and above) methods for asynchronous call and to set up cancellation or for reporting progress.

To reload the content use the BitmapDataFactory.Load method.

The saved content always preserves known KnownPixelFormats so the BitmapDataFactory.Load method can restore it the same way on any platform. Custom pixel formats are saved by a compatible known pixel format.

See Also