.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

OfficeImage.GetImageBytesStreamSafe(OfficeImageFormat) Method

Attempts to get image data as a stream in the specified format, and in case of a failure, gets the data in PNG format.

Namespace: DevExpress.Office.Utils

Assembly: DevExpress.Office.v20.1.Core.dll

Declaration

public virtual Stream GetImageBytesStreamSafe(
    OfficeImageFormat imageFormat
)
Public Overridable Function GetImageBytesStreamSafe(
    imageFormat As OfficeImageFormat
) As Stream

Parameters

Name Type Description
imageFormat OfficeImageFormat

An OfficeImageFormat enumeration member specifying the format of the resulting image data.

Returns

Type Description
Stream

A Stream containing image data.

Remarks

The GetImageBytesStreamSafe method prevents an unknown format exception from being fired and uses the PNG format as a fallback.

See Also