Improve this Doc View Source

Class BitmapHttpContentConverter

This can convert HttpContent from/to a GDI Bitmap

Inheritance
System.Object
BitmapHttpContentConverter
Namespace:Dapplo.HttpExtensions.ContentConverter
Assembly:Dapplo.HttpExtensions.dll
Syntax
public class BitmapHttpContentConverter : IHttpContentConverter

Constructors

| Improve this Doc View Source

BitmapHttpContentConverter()

Declaration
public BitmapHttpContentConverter()

Fields

| Improve this Doc View Source

Instance

Declaration
public static readonly BitmapHttpContentConverter Instance

Properties

| Improve this Doc View Source

EncoderParameters

Check the parameters for the encoder, like setting Jpg quality

Declaration
public IList<EncoderParameter> EncoderParameters { get; }
Returns
Type Description
System.Collections.Generic.IList<System.Drawing.Imaging.EncoderParameter>
| Improve this Doc View Source

Format

Declaration
public ImageFormat Format { get; set; }
Returns
Type Description
System.Drawing.Imaging.ImageFormat
| Improve this Doc View Source

Order

Declaration
public int Order { get; }
Returns
Type Description
System.Int32
| Improve this Doc View Source

Quality

Set the quality EncoderParameter, for the Jpg format 0-100

Declaration
public int Quality { get; set; }
Returns
Type Description
System.Int32

Methods

| Improve this Doc View Source

AddAcceptHeadersForType(Type, HttpRequestMessage)

Declaration
public void AddAcceptHeadersForType(Type resultType, HttpRequestMessage httpRequestMessage)
Parameters
Type Name Description
System.Type resultType
System.Net.Http.HttpRequestMessage httpRequestMessage
| Improve this Doc View Source

CanConvertFromHttpContent(Type, HttpContent)

This checks if the HttpContent can be converted to a Bitmap and is assignable to the specified Type

Declaration
public bool CanConvertFromHttpContent(Type typeToConvertTo, HttpContent httpContent)
Parameters
Type Name Description
System.Type typeToConvertTo

This should be something we can assign Bitmap to

System.Net.Http.HttpContent httpContent

HttpContent to process

Returns
Type Description
System.Boolean

true if it can convert

| Improve this Doc View Source

CanConvertToHttpContent(Type, Object)

Declaration
public bool CanConvertToHttpContent(Type typeToConvert, object content)
Parameters
Type Name Description
System.Type typeToConvert
System.Object content
Returns
Type Description
System.Boolean
| Improve this Doc View Source

ConvertFromHttpContentAsync(Type, HttpContent, CancellationToken)

Declaration
public Task<object> ConvertFromHttpContentAsync(Type resultType, HttpContent httpContent, CancellationToken token = null)
Parameters
Type Name Description
System.Type resultType
System.Net.Http.HttpContent httpContent
System.Threading.CancellationToken token
Returns
Type Description
System.Threading.Tasks.Task<System.Object>
| Improve this Doc View Source

ConvertToHttpContent(Type, Object)

Declaration
public HttpContent ConvertToHttpContent(Type typeToConvert, object content)
Parameters
Type Name Description
System.Type typeToConvert
System.Object content
Returns
Type Description
System.Net.Http.HttpContent