FileSystemImageSourceGetImageStream Method |
Returns an object that contains information about the stream that contains the requested image. When you
call this, the ImageStream member of the returned object will be open and the caller is responsible for closing it.
Namespace:
Atalasoft.Imaging
Assembly:
Atalasoft.dotImage (in Atalasoft.dotImage.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax public ImageSourceStreamInfo GetImageStream(
int index
)
Public Function GetImageStream (
index As Integer
) As ImageSourceStreamInfo
Parameters
- index
- Type: SystemInt32
The index of the image within the ImageSource.
Return Value
Type:
ImageSourceStreamInfo
An object that contains the stream and information for finding the requested image within it.
Implements
IImageStreamSourceGetImageStream(Int32)Examples Requesting a Stream from an ImageSource (C#)
public Size GetSize(RandomAccessImageSource src, int index)
{
if (src is IImageStreamSource)
{
ImageSourceStreamInfo info = ((IImageStreamSource)src).GetImageStream(index);
using (Stream s = info.ImageStream)
{
return RegisteredDecoders.GetImageInfo(s, info.Frame).Size;
}
} else {
return src[index].Size;
}
}
See Also