GeoImage¶
Namespace: ThinkGeo.Core
public class GeoImage : System.IDisposable
Inheritance Object → GeoImage
 Implements IDisposable
Properties¶
PathFilename¶
Gets the path filename.
public string PathFilename { get; }
Property Value¶
        The path filename.
Opacity¶
Gets or sets the opacity.
public float Opacity { get; set; }
Property Value¶
        The opacity.
Width¶
Gets the width.
public int Width { get; }
Property Value¶
        The width.
Height¶
Gets the height.
public int Height { get; }
Property Value¶
        The height.
NativeImage¶
public SKBitmap NativeImage { get; }
Property Value¶
SKBitmap
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.
GeoImage(SKBitmap)¶
Initializes a new instance of the GeoImage class.
public GeoImage(SKBitmap skBitmap)
Parameters¶
skBitmap SKBitmap
 A SKBitmap object, it's an cross-platform bitmap object from SKIA-Sharp
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¶
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¶
ToBytesArray()¶
public Byte[] ToBytesArray()
Returns¶
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¶
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¶
Scale(Int32, Int32)¶
Scales the specified width.
public GeoImage Scale(int targetWidth, int targetHeight)
Parameters¶
targetWidth Int32
 The width.
targetHeight Int32
 The height.
Returns¶
Crop(DrawingRectangle)¶
Cuts the specified source rect.
public GeoImage Crop(DrawingRectangle srcRect)
Parameters¶
srcRect DrawingRectangle
 The source rect.
Returns¶
Clip(DrawingRectangle, Int32, Int32)¶
public GeoImage Clip(DrawingRectangle clippingRectangle, int clippingWidth, int clippingHeight)
Parameters¶
clippingRectangle DrawingRectangle
clippingWidth Int32
clippingHeight Int32
Returns¶
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[], Single)¶
Appends the text.
public void DrawText(string text, GeoFont font, GeoBrush fillBrush, ScreenPointF[] points, float scaleFactor)
Parameters¶
text String
 The text.
font GeoFont
 The font.
fillBrush GeoBrush
 The fill brush.
points ScreenPointF[]
 The points.
scaleFactor Single
HasCpuPixelData()¶
Determines whether the underlying SKBitmap has its pixel data laid out in a contiguous CPU‐accessible buffer in RGBA or BGRA format.
public bool HasCpuPixelData()
Returns¶
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¶
ApplyColorMappings(Dictionary<GeoColor, GeoColor>)¶
internal GeoImage ApplyColorMappings(Dictionary<GeoColor, GeoColor> colorMappings)
Parameters¶
colorMappings Dictionary<GeoColor, GeoColor>