Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.Core.dll

NuGet Package: DevExpress.Office.Core

#Declaration

public virtual Stream GetImageBytesStreamSafe(
    OfficeImageFormat imageFormat
)

#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