API Reference
OfficeImageInfo
Bounded image metadata used by Office Open XML packages.
Inheritance
- Object
- OfficeImageInfo
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Property OfficeImageOptimizationResult.Final
- Property OfficeImageOptimizationResult.Original
- Method OfficeImageReader.Identify
- Method OfficeImageReader.Identify
Accepted by parameters
- Method OfficeImageOrientationNormalizer.TryNormalizeToPng
- Method OfficeImageOrientationNormalizer.TryNormalizeToPng
- Method OfficeImagePdfCompatibility.TryValidate
- Method OfficeImagePdfCompatibility.TryValidate
- Method OfficeImagePdfCompatibility.TryValidateDeclaredContentType
- Method OfficeImagePdfCompatibility.TryValidateTranscodeDimensions
- Method OfficeImageReader.TryIdentify
- Method OfficeImageReader.TryIdentify
- Method OfficeImageReader.TryIdentifyByContent
- Method OfficeImageReader.TryIdentifyByContent
- Method OfficeImageReader.TryValidateContent
- Method OfficeImageReader.TryValidateContent
- Method OfficeImageReader.TryValidateContent
- Method OfficeImageReader.TryValidateContent
Constructors
public OfficeImageInfo(OfficeImageFormat format, Int32 width, Int32 height, Double dpiX = 96, Double dpiY = 96) #Creates a new image metadata value.
Parameters
- format OfficeIMO.Drawing.OfficeImageFormat
- width System.Int32
- height System.Int32
- dpiX System.Double = 96
- dpiY System.Double = 96
public OfficeImageInfo(OfficeImageFormat format, Int32 width, Int32 height, Double dpiX, Double dpiY, Nullable<Double> aspectRatio) #Creates image metadata with an explicit intrinsic aspect ratio when dimensions alone cannot preserve it.
Parameters
- format OfficeIMO.Drawing.OfficeImageFormat
- width System.Int32
- height System.Int32
- dpiX System.Double
- dpiY System.Double
- aspectRatio System.Nullable{System.Double}
Methods
public static OfficeImageFormat FromMimeType(String contentType) #OfficeImageFormatMaps a MIME content type to a known image format.
Parameters
- contentType System.String
- MIME content type, optionally with parameters.
Returns
The matching image format, or Unknown when unsupported.
public static String GetDefaultExtension(OfficeImageFormat format) #StringReturns the canonical file extension for a known image format.
Parameters
- format OfficeIMO.Drawing.OfficeImageFormat
- Image format.
Returns
The default file extension including the leading dot, or .bin for unknown formats.
public static String GetMimeType(OfficeImageFormat format) #StringReturns the default MIME type for a known image format.
Parameters
- format OfficeIMO.Drawing.OfficeImageFormat
- Image format.
Returns
The default MIME content type, or application/octet-stream for unknown formats.
public static String GetMimeTypeFromExtension(String fileName) #StringReturns the default MIME type for an image file name or extension.
Parameters
- fileName System.String
- File name, path, or bare extension.
Returns
The default MIME content type, or application/octet-stream for unknown formats.
public static Boolean IsBrowserPreviewSafeContentType(String contentType) #BooleanReturns whether the image MIME content type is safe for inline HTML preview galleries.
Parameters
- contentType System.String
- MIME content type, optionally with parameters.
Returns
true when the content type maps to an inline-preview-safe image format.
public static Boolean IsBrowserPreviewSafeExtension(String fileName) #BooleanReturns whether the image file name or extension is safe for inline HTML preview galleries.
Parameters
- fileName System.String
- File name, path, or bare extension.
Returns
true when the extension maps to an inline-preview-safe image format.
public static Boolean IsBrowserPreviewSafeFormat(OfficeImageFormat format) #BooleanReturns whether the image format is safe for inline HTML preview galleries.
Parameters
- format OfficeIMO.Drawing.OfficeImageFormat
- Image format.
Returns
true when the format can be previewed inline without embedding active SVG markup.
public static String NormalizeMimeType(String contentType) #StringNormalizes a MIME content type by removing parameters and applying case-insensitive comparison casing.
Parameters
- contentType System.String
- MIME content type, optionally with parameters.
Returns
The normalized MIME content type, or an empty string for missing values.
public static Boolean TryNormalizeImageContentType(String contentType, out String normalizedContentType) #BooleanTries to normalize an image MIME content type by trimming parameters and canonicalizing known aliases.
Parameters
- contentType System.String
- MIME content type, optionally with parameters.
- normalizedContentType System.String@
- Canonical image MIME type for known formats, or the normalized image MIME type for unknown image formats.
Returns
true when the value is an image MIME type.
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public OfficeImageFormat Format { get; } #Image format.
public Int32 Width { get; } #Width in pixels, or 0 when unknown.
public Int32 Height { get; } #Height in pixels, or 0 when unknown.
public Double DpiX { get; } #Horizontal resolution in DPI. Defaults to 96 when absent.
public Double DpiY { get; } #Vertical resolution in DPI. Defaults to 96 when absent.
public Nullable<Double> AspectRatio { get; } #Intrinsic width-to-height ratio when known independently of complete pixel dimensions.
public String MimeType { get; } #Default MIME type for the detected format.