Table of Contents

Struct Image

Namespace
Discord
Assembly
Discord.Net.Core.dll

An image that will be uploaded to Discord.

public struct Image : IDisposable
Implements
Inherited Members

Constructors

Image(Stream)

Create the image with a Stream.

public Image(Stream stream)

Parameters

stream Stream

The 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.

public Image(string path)

Parameters

path string

The path to the file.

Remarks

This file path is NOT validated and is passed directly into a OpenRead(string).

Exceptions

ArgumentException

path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by GetInvalidPathChars().

ArgumentNullException

path is null.

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.

NotSupportedException

path is in an invalid format.

DirectoryNotFoundException

The specified path is invalid, (for example, it is on an unmapped drive).

UnauthorizedAccessException

path specified a directory.-or- The caller does not have the required permission.

FileNotFoundException

The file specified in path was not found.

IOException

An I/O error occurred while opening the file.

Properties

Stream

Gets the stream to be uploaded to Discord.

public readonly Stream Stream { get; }

Property Value

Stream

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()