C# Class TinyPng.TinyPngClient

Inheritance: IDisposable
Afficher le fichier Open project: ctolkien/TinyPNG

Méthodes publiques

Свойство Type Description
httpClient System.Net.Http.HttpClient

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Private Methods

Méthode Description
CreateContent ( Stream source ) : HttpContent
CreateContent ( byte source ) : HttpContent

Method Details

Compress() public méthode

Compress stream
public Compress ( Stream data ) : Task
data Stream
Résultat Task

Compress() public méthode

Compress byte array of image
public Compress ( byte data ) : Task
data byte Byte array of the data to compress
Résultat Task

Compress() public méthode

Compress file
public Compress ( string pathToFile ) : Task
pathToFile string Path to file on disk
Résultat Task

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

Download() public méthode

public Download ( TinyPngCompressResponse result ) : Task
result TinyPng.Responses.TinyPngCompressResponse
Résultat Task

Resize() public méthode

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 , , ,
Résultat Task

Resize() public méthode

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
Résultat Task

SaveCompressedImageToAmazonS3() public méthode

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
Résultat Task

SaveCompressedImageToAmazonS3() public méthode

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
Résultat Task

TinyPngClient() public méthode

Wrapper for the tinypng.com API
public TinyPngClient ( string apiKey ) : System
apiKey string Your tinypng.com API key, signup here: https://tinypng.com/developers
Résultat System

TinyPngClient() public méthode

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
Résultat System

Property Details

httpClient public_oe property

public HttpClient,System.Net.Http httpClient
Résultat System.Net.Http.HttpClient