Class ImageUtils
Provides helpers for reading supported documentation image files.
public class ImageUtils
- Inheritance
-
ImageUtils
- Inherited Members
Methods
GetContentType(FileInfo)
Resolves the MIME type for a supported image file.
public static string GetContentType(FileInfo file)
Parameters
fileFileInfoThe image file to inspect.
Returns
- string
The MIME type for the image.
Exceptions
- ArgumentException
Thrown when
fileis missing, is a directory, does not exist, or is not a supported image type.
GetImageAsBase64(FileInfo)
Reads a supported image file and returns its Base64-encoded bytes.
public static string GetImageAsBase64(FileInfo file)
Parameters
fileFileInfoThe image file to read.
Returns
- string
The Base64-encoded image content.
Exceptions
- ArgumentException
Thrown when
fileis missing, invalid, or unsupported.
GetImageAsDataUri(FileInfo)
Reads a supported image file and returns it as a data URI.
public static string GetImageAsDataUri(FileInfo file)
Parameters
fileFileInfoThe image file to read.
Returns
- string
A data URI that embeds the image content.
Exceptions
- ArgumentException
Thrown when
fileis missing, invalid, or unsupported.