Show / Hide Table of Contents

Struct Image

An image that will be uploaded to Discord.

Implements
System.IDisposable
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Namespace: Discord
Assembly: Discord.Net.Core.dll
Syntax
public struct Image : IDisposable

Constructors

| Improve this Doc View Source

Image(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.

| Improve this Doc View Source

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

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

System.ArgumentNullException

path is null.

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

path is in an invalid format.

System.IO.DirectoryNotFoundException

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

System.UnauthorizedAccessException

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

System.IO.FileNotFoundException

The file specified in path was not found.

System.IO.IOException

An I/O error occurred while opening the file.

Properties

| Improve this Doc View Source

Stream

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 Source

Dispose()

Declaration
public void Dispose()

Implements

System.IDisposable
  • Improve this Doc
  • View Source
Back to top Generated by DocFX