Method GetImageCount
GetImageCount(string?, BitmapType)
If the image file contains more than one image and the image handler is capable of retrieving these individually, this function will return the number of available images.
public static int GetImageCount(string? url, BitmapType bitmapType = BitmapType.Any)
Parameters
url
stringPath or url to file with image data.
bitmapType
BitmapTypeType of the bitmap. Depending on how library and OS has been configured and by which handlers have been loaded, not all formats may be available. If value is Any, function will try to autodetect the format.
Returns
- int
Number of available images. For most image handlers, this is 1 (exceptions are TIFF and ICO formats as well as animated GIFs for which this function returns the number of frames in the animation).
GetImageCount(Stream, BitmapType)
If the image stream contains more than one image and the image handler is capable of retrieving these individually, this function will return the number of available images.
public static int GetImageCount(Stream stream, BitmapType bitmapType = BitmapType.Any)
Parameters
stream
StreamOpened input stream from which to load the image. Currently, the stream must support seeking.
bitmapType
BitmapTypeType of the bitmap. Depending on how library and OS has been configured and by which handlers have been loaded, not all formats may be available. If value is Any, function will try to autodetect the format.
Returns
- int
Number of available images. For most image handlers, this is 1 (exceptions are TIFF and ICO formats as well as animated GIFs for which this function returns the number of frames in the animation).