Class ImageTool
Tool to detect image formats and convert from binary data to base64 strings.
Inheritance
System.Object
ImageTool
Namespace: DisCatSharp
Assembly: DisCatSharp.dll
Syntax
public sealed class ImageTool : IDisposable
Constructors
| Improve this Doc View SourceImageTool(Stream)
Creates a new image tool from given stream.
Declaration
public ImageTool(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to work with. |
Properties
| Improve this Doc View SourceSourceStream
Gets the stream this tool is operating on.
Declaration
public Stream SourceStream { get; }
Property Value
Type | Description |
---|---|
System.IO.Stream |
Methods
| Improve this Doc View SourceBase64FromStream(Optional<Stream>)
Utility function to convert an optional image stream into an optional base 64 string.
Declaration
public static Optional<string> Base64FromStream(Optional<Stream> stream)
Parameters
Type | Name | Description |
---|---|---|
Optional<System.IO.Stream> | stream | The optional stream. |
Returns
Type | Description |
---|---|
Optional<System.String> | The optional base 64 string. |
Base64FromStream(Stream)
Utility function to convert an image stream into a base 64 string.
Declaration
public static string Base64FromStream(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream. |
Returns
Type | Description |
---|---|
System.String | The base 64 string. |
Dispose()
Disposes this image tool.
Declaration
public void Dispose()
GetBase64()
Converts this image into base64 data format string.
Declaration
public string GetBase64()
Returns
Type | Description |
---|---|
System.String | Data-scheme base64 string. |
GetFormat()
Detects the format of this image.
Declaration
public ImageFormat GetFormat()
Returns
Type | Description |
---|---|
ImageFormat | Detected format. |