C# Класс TinyPng.TinyPngClient

Наследование: IDisposable
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
httpClient System.Net.Http.HttpClient

Открытые методы

Метод Описание
Compress ( Stream data ) : Task

Compress stream

Compress ( byte data ) : Task

Compress byte array of image

Compress ( string pathToFile ) : Task

Compress file

Dispose ( ) : void
Download ( TinyPngCompressResponse result ) : Task
Resize ( TinyPngCompressResponse result, ResizeOperation resizeOperation ) : Task

Uses the TinyPng API to create a resized version of your uploaded image.

Resize ( TinyPngCompressResponse result, int width, int height, ResizeType resizeType = ResizeType.Fit ) : Task

Uses the TinyPng API to create a resized version of your uploaded image.

SaveCompressedImageToAmazonS3 ( TinyPngCompressResponse result, AmazonS3Configuration amazonSettings, string path ) : Task

Stores a previously compressed image directly into Amazon S3 storage

SaveCompressedImageToAmazonS3 ( TinyPngCompressResponse result, string path, string bucketOverride = "", string regionOverride = "" ) : Task

Stores a previously compressed image directly into Amazon S3 storage

TinyPngClient ( string apiKey ) : System

Wrapper for the tinypng.com API

TinyPngClient ( string apiKey, AmazonS3Configuration amazonConfiguration ) : System

Wrapper for the tinypng.com API

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Приватные методы

Метод Описание
CreateContent ( Stream source ) : HttpContent
CreateContent ( byte source ) : HttpContent

Описание методов

Compress() публичный Метод

Compress stream
public Compress ( Stream data ) : Task
data Stream
Результат Task

Compress() публичный Метод

Compress byte array of image
public Compress ( byte data ) : Task
data byte Byte array of the data to compress
Результат Task

Compress() публичный Метод

Compress file
public Compress ( string pathToFile ) : Task
pathToFile string Path to file on disk
Результат Task

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

Download() публичный Метод

public Download ( TinyPngCompressResponse result ) : Task
result TinyPng.Responses.TinyPngCompressResponse
Результат Task

Resize() публичный Метод

Uses the TinyPng API to create a resized version of your uploaded image.
public Resize ( TinyPngCompressResponse result, ResizeOperation resizeOperation ) : Task
result TinyPng.Responses.TinyPngCompressResponse This is the previous result of running a compression
resizeOperation ResizeOperation Supply a strongly typed Resize Operation. See , , ,
Результат Task

Resize() публичный Метод

Uses the TinyPng API to create a resized version of your uploaded image.
public Resize ( TinyPngCompressResponse result, int width, int height, ResizeType resizeType = ResizeType.Fit ) : Task
result TinyPng.Responses.TinyPngCompressResponse This is the previous result of running a compression
width int
height int
resizeType ResizeType
Результат Task

SaveCompressedImageToAmazonS3() публичный Метод

Stores a previously compressed image directly into Amazon S3 storage
public SaveCompressedImageToAmazonS3 ( TinyPngCompressResponse result, AmazonS3Configuration amazonSettings, string path ) : Task
result TinyPng.Responses.TinyPngCompressResponse The previously compressed image
amazonSettings AmazonS3Configuration The settings for the amazon connection
path string The path and bucket to store in: bucket/file.png format
Результат Task

SaveCompressedImageToAmazonS3() публичный Метод

Stores a previously compressed image directly into Amazon S3 storage
public SaveCompressedImageToAmazonS3 ( TinyPngCompressResponse result, string path, string bucketOverride = "", string regionOverride = "" ) : Task
result TinyPng.Responses.TinyPngCompressResponse The previously compressed image
path string The path to storage the image as
bucketOverride string Optional: To override the previously configured bucket
regionOverride string Optional: To override the previously configured region
Результат Task

TinyPngClient() публичный Метод

Wrapper for the tinypng.com API
public TinyPngClient ( string apiKey ) : System
apiKey string Your tinypng.com API key, signup here: https://tinypng.com/developers
Результат System

TinyPngClient() публичный Метод

Wrapper for the tinypng.com API
public TinyPngClient ( string apiKey, AmazonS3Configuration amazonConfiguration ) : System
apiKey string Your tinypng.com API key, signup here: https://tinypng.com/developers
amazonConfiguration AmazonS3Configuration Configures defaults to use for storing images on Amazon S3
Результат System

Описание свойств

httpClient публичное свойство

public HttpClient,System.Net.Http httpClient
Результат System.Net.Http.HttpClient