Skip to content

WpfRasterLayer

Namespace: ThinkGeo.UI.Wpf

This class allows you to view standard image types such as BMP, JPG, and PNG, using wpf classes such as BitmapSource

public class WpfRasterLayer : ThinkGeo.Core.RasterLayer

Inheritance Object → LayerBase → Layer → RasterLayer → WpfRasterLayer

Remarks:

This class handles all default supported image types of Windows. Any image can be opened by ImageView on Windows can also be opened by this class. As none of these types embed geographic information in them, you will need to ensure that the image file is always accompanied by a world file. The world file is text file that stores the associated geographic information we need to properly display the image along with your other feature data.

Properties

HasBoundingBox

This property checks to see if a Layer has a BoundingBox or not. If it has no BoundingBox, it will throw an exception when you call the GetBoundingBox() and GetFullExtent() APIs. In GdiPlusRasterLayer, we override this API and mark it as true.

public bool HasBoundingBox { get; }

Property Value

Boolean

Remarks:

The default implementation in the base class returns false.

ImagePathFilename

This property gets and sets the path and filename of the image file you want to use.

public string ImagePathFilename { get; set; }

Property Value

String
This property gets the path and filename of the image file you want to use.

Remarks:

This should be a complete path and filename for the image file.

ImageSource

public RasterSource ImageSource { get; protected set; }

Property Value

RasterSource

UpperThreshold

public double UpperThreshold { get; set; }

Property Value

Double

LowerThreshold

public double LowerThreshold { get; set; }

Property Value

Double

UpperScale

public double UpperScale { get; set; }

Property Value

Double

LowerScale

public double LowerScale { get; set; }

Property Value

Double

ScaleFactor

public double ScaleFactor { get; set; }

Property Value

Double

Projection

public Projection Projection { get; }

Property Value

Projection

RequestDrawingInterval

public TimeSpan RequestDrawingInterval { get; set; }

Property Value

TimeSpan

Name

public string Name { get; set; }

Property Value

String

IsOpen

public bool IsOpen { get; }

Property Value

Boolean

IsVisible

public bool IsVisible { get; set; }

Property Value

Boolean

DrawingTime

public TimeSpan DrawingTime { get; protected set; }

Property Value

TimeSpan

DrawingExceptionMode

public DrawingExceptionMode DrawingExceptionMode { get; set; }

Property Value

DrawingExceptionMode

Background

public GeoColor Background { get; set; }

Property Value

GeoColor

Transparency

public float Transparency { get; set; }

Property Value

Single

BlueTranslation

public float BlueTranslation { get; set; }

Property Value

Single

RedTranslation

public float RedTranslation { get; set; }

Property Value

Single

GreenTranslation

public float GreenTranslation { get; set; }

Property Value

Single

KeyColors

public Collection<GeoColor> KeyColors { get; }

Property Value

Collection<GeoColor>

IsNegative

public bool IsNegative { get; set; }

Property Value

Boolean

IsGrayscale

public bool IsGrayscale { get; set; }

Property Value

Boolean

ThreadSafe

public ThreadSafetyLevel ThreadSafe { get; set; }

Property Value

ThreadSafetyLevel

ColorMappings

public Dictionary<GeoColor, GeoColor> ColorMappings { get; }

Property Value

Dictionary<GeoColor, GeoColor>

WrappingMode

public WrappingMode WrappingMode { get; set; }

Property Value

WrappingMode

WrappingExtent

public RectangleShape WrappingExtent { get; set; }

Property Value

RectangleShape

Constructors

WpfRasterLayer()

This is a constructor for the class.

public WpfRasterLayer()

Remarks:

If you use this constructor, then you need to set the PathFilename property manually before using the layer.

WpfRasterLayer(String)

This is a constructor for the class.

public WpfRasterLayer(string imagePathFilename)

Parameters

imagePathFilename String
This parameter is the path and filename of the GDI+ image file you want to use. If you want to load a Tiff(.tif or .tiff) files, please use the GeoTiffRasterLayer instead for better performance.

Remarks:

This constructor gets the layer ready to use.

WpfRasterLayer(String, String)

This is a constructor for the class.

public WpfRasterLayer(string imagePathFilename, string worldFilePathFilename)

Parameters

imagePathFilename String
This parameter is the path and filename of the GDI+ image file you want to use. If you want to load a Tiff(.tif or .tiff) files, please use the GeoTiffRasterLayer instead for better performance.

worldFilePathFilename String
This parameter is the world file path and filename for the GDI+ image you want to use.

Remarks:

This constructor gets the layer ready to use.

WpfRasterLayer(String, RectangleShape)

This is a constructor for the class.

public WpfRasterLayer(string imagePathFilename, RectangleShape imageExtent)

Parameters

imagePathFilename String
This parameter is the path and filename of the GDI+ image file you want to use. If you want to load a Tiff(.tif or .tiff) files, please use the GeoTiffRasterLayer instead for better performance.

imageExtent RectangleShape
This parameter is the image extent of GDI+ image file you want to use.

Remarks:

This constructor gets the layer ready to use.

Events

StreamLoading

This event allows you to pass in your own stream to represent the image.

public event EventHandler<StreamLoadingEventArgs> StreamLoading;

Remarks:

If you wish, you can pass in your own stream to represent the image. The stream can come from a variety of places, including isolated storage, a compressed file, or an encrypted stream. When the image is finished with the stream it will dispose of it, so be sure to keep this in mind when passing the stream in. If you do not pass in an alternate stream, the class will attempt to load the file from the file system using the PathFilename property.

DrawingProgressChanged

public event EventHandler<DrawingProgressChangedEventArgs> DrawingProgressChanged;

RequestedDrawing

public event EventHandler<RequestedDrawingLayerEventArgs> RequestedDrawing;

RequestingDrawing

public event EventHandler<RequestingDrawingLayerEventArgs> RequestingDrawing;

DrawingException

public event EventHandler<DrawingExceptionLayerEventArgs> DrawingException;

DrawnException

public event EventHandler<DrawnExceptionLayerEventArgs> DrawnException;