Skip to content

GeoImage

Namespace: ThinkGeo.Core

public class GeoImage : System.IDisposable

Inheritance ObjectGeoImage
Implements IDisposable

Properties

PathFilename

Gets the path filename.

public string PathFilename { get; }

Property Value

String

        The path filename.

Opacity

Gets or sets the opacity.

public float Opacity { get; set; }

Property Value

Single

        The opacity.

Width

Gets the width.

public int Width { get; }

Property Value

Int32

        The width.

Height

Gets the height.

public int Height { get; }

Property Value

Int32

        The height.

NativeImage

public object NativeImage { get; internal set; }

Property Value

Object

Constructors

GeoImage()

Initializes a new instance of the GeoImage class.

public GeoImage()

GeoImage(Int32, Int32)

Initializes a new instance of the GeoImage class.

public GeoImage(int width, int height)

Parameters

width Int32
The width.

height Int32
The height.

GeoImage(Stream)

Initializes a new instance of the GeoImage class.

public GeoImage(Stream stream)

Parameters

stream Stream
The stream.

GeoImage(String)

Initializes a new instance of the GeoImage class.

public GeoImage(string pathFilename)

Parameters

pathFilename String
The path filename.

GeoImage(Byte[])

Initializes a new instance of the GeoImage class.

public GeoImage(Byte[] bytes)

Parameters

bytes Byte[]
The bytes.

Methods

CreateCustomizedImage(Int32, Int32, GeoColorType, GeoAlphaType)

Creates the customized image.

public static GeoImage CreateCustomizedImage(int width, int height, GeoColorType colorType, GeoAlphaType alphaType)

Parameters

width Int32
The width.

height Int32
The height.

colorType GeoColorType
Type of the color.

alphaType GeoAlphaType
Type of the alpha.

Returns

GeoImage

GetImageBytes(GeoImageFormat, Int32)

Gets the image bytes.

public Byte[] GetImageBytes(GeoImageFormat imageFormat, int imageQuality)

Parameters

imageFormat GeoImageFormat
The image format.

imageQuality Int32
The image quality.

Returns

Byte[]

GetImageStream(GeoImageFormat, Int32)

Gets the image stream.

public Stream GetImageStream(GeoImageFormat imageFormat, int imageQuality)

Parameters

imageFormat GeoImageFormat
The image format.

imageQuality Int32
The image quality.

Returns

Stream

Save(Stream, GeoImageFormat, Int32)

Saves the specified stream.

public void Save(Stream stream, GeoImageFormat imageFormat, int quality)

Parameters

stream Stream
The stream.

imageFormat GeoImageFormat
The image format.

quality Int32
The quality.

Save(String, GeoImageFormat, Int32)

Saves the specified file path.

public void Save(string filePath, GeoImageFormat imageFormat, int quality)

Parameters

filePath String
The file path.

imageFormat GeoImageFormat
The image format.

quality Int32
The quality.

Dispose()

This method implements the IDispose method. This method is the concrete wrapper for the abstract method DisposeCore.

public void Dispose()

Finalize()

Finalizer of this tile object.

protected void Finalize()

Dispose(Boolean)

This method disposes all the unmanaged resource in the tile.

protected void Dispose(bool disposing)

Parameters

disposing Boolean

Remarks:

When implementing this method, consider the stop the background threading when drawing asynchronously.

Clear(GeoColor)

Clears the specified color.

public void Clear(GeoColor color)

Parameters

color GeoColor
The color.

SetPixels(GeoColor[])

Sets the pixels.

public void SetPixels(GeoColor[] pixels)

Parameters

pixels GeoColor[]
The pixels.

GetIntPtr()

Gets the pixels.

public IntPtr GetIntPtr()

Returns

IntPtr

Scale(Int32, Int32)

Scales the specified width.

public GeoImage Scale(int targetWidth, int targetHeight)

Parameters

targetWidth Int32
The width.

targetHeight Int32
The height.

Returns

GeoImage

Crop(DrawingRectangle)

Cuts the specified source rect.

public GeoImage Crop(DrawingRectangle srcRect)

Parameters

srcRect DrawingRectangle
The source rect.

Returns

GeoImage

Clip(DrawingRectangle, Int32, Int32)

public GeoImage Clip(DrawingRectangle clippingRectangle, int clippingWidth, int clippingHeight)

Parameters

clippingRectangle DrawingRectangle

clippingWidth Int32

clippingHeight Int32

Returns

GeoImage

DrawImage(GeoImage, Single, Single)

Combines the images.

public void DrawImage(GeoImage geoImage, float pointX, float pointY)

Parameters

geoImage GeoImage

pointX Single

pointY Single

DrawText(String, GeoFont, GeoBrush, ScreenPointF[])

Appends the text.

public void DrawText(string text, GeoFont font, GeoBrush fillBrush, ScreenPointF[] points)

Parameters

text String
The text.

font GeoFont
The font.

fillBrush GeoBrush
The fill brush.

points ScreenPointF[]
The points.

ApplyTranslations(Boolean, Boolean, Single, Single, Single, Single)

Applies the translations.

internal GeoImage ApplyTranslations(bool isGrayscale, bool isNegative, float transparency, float redTranslation, float greenTranslation, float blueTranslation)

Parameters

isGrayscale Boolean
if set to true [is grayscale].

isNegative Boolean
if set to true [is negative].

transparency Single
The transparency.

redTranslation Single
The red translation.

greenTranslation Single
The green translation.

blueTranslation Single
The blue translation.

Returns

GeoImage

ApplyColorMappings(Dictionary<GeoColor, GeoColor>)

internal GeoImage ApplyColorMappings(Dictionary<GeoColor, GeoColor> colorMappings)

Parameters

colorMappings Dictionary<GeoColor, GeoColor>

Returns

GeoImage