Struct Image
An image that will be uploaded to Discord.
Implements
Inherited Members
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public struct Image : IDisposable
Constructors
| Improve this Doc View SourceImage(Stream)
Create the image with a System.IO.Stream.
Declaration
public Image(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | The System.IO.Stream to create the image with. Note that this must be some type of stream with the contents of a file in it. |
Image(String)
Create the image from a file path.
Declaration
public Image(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | path | The path to the file. |
Remarks
This file path is NOT validated and is passed directly into a System.IO.File.OpenRead(System.String).
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentException |
|
| System.ArgumentNullException |
|
| System.IO.PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. |
| System.NotSupportedException |
|
| System.IO.DirectoryNotFoundException | The specified |
| System.UnauthorizedAccessException |
|
| System.IO.FileNotFoundException | The file specified in |
| System.IO.IOException | An I/O error occurred while opening the file. |
Properties
| Improve this Doc View SourceStream
Gets the stream to be uploaded to Discord.
Declaration
public Stream Stream { get; }
Property Value
| Type | Description |
|---|---|
| System.IO.Stream |
Methods
| Improve this Doc View SourceDispose()
Declaration
public void Dispose()