User Tools

Site Tools


thinkgeo.mapsuite.core.geoimage

This is an old revision of the document!


ThinkGeo.MapSuite.Core.GeoImage

<!– Class –> This class represents an image you want to use on the GeoCanvas.

Remarks

This class was designed so that it can be used for any type of stream while still being easy to use. For example, you can specify a path and filename in the constructor and the class will hold this. When the GeoCanvas needs the image, it will get its stream and then pass it off for drawing. After drawing, it disposes of the stream so there are no wasted resources.

You can also pass in a path and filename that does not actually exist on disk. In that case we will raise an event where you can provide a stream on demand. With this function, you can use compressed streams, isolated storage and many other stream-related storage machanisms.

Inheritance Hierarchy

Members Summary

Public Constructors

Name Parameters DeclaringType Summary
Public MethodGeoImage This is the constructor used to create a new GeoImage.
Public MethodGeoImage String This is the constructor to create a new GeoImage
Public MethodGeoImage Stream This is the constructor to create a new GeoImage.
Public MethodGeoImage Int32, Int32 This is the constructor to create a new GeoImage

Protected Constructors

Name Parameters DeclaringType Summary

Public Methods

Name Parameters DeclaringType Summary
Public MethodClose This method closes the GeoImage. It is the same as calling the Dispose.
Public MethodDispose This is the Dispose for the class.
Public MethodEquals Object Object
Public MethodGetHashCode Object
Public MethodGetHeight This method gets the height (in pixels) of this image.
Public MethodGetImageStream GeoCanvas This method returns the stream of the GeoImage.
Public MethodGetType Object
Public MethodGetWidth This method gets the width (in pixels) of this image.
Public MethodToString Object

Protected Methods

Name Parameters DeclaringType Summary
Protected MethodFinalize Object(overriden) This is the Dispose method for the class.
Protected MethodGetImageStreamCore GeoCanvas This method returns the stream of the GeoImage.
Protected MethodMemberwiseClone Object
Protected MethodOnStreamLoading StreamLoadingEventArgs This method raises the StreamLoading event, allowing you to specify your own stream.

Public Properties

Name Return DeclaringType Summary
Public PropertyCanvasImageFormat Guid This property returns the image format.
Public PropertyFileName String This property returns the filename part of the PathFileName.
Public PropertyPathFilename String This property returns the path and filename of the image you want to represent.
Public PropertyPathName String This property returns the path part of the PathFileName.

Protected Properties

Name Return DeclaringType Summary

Public Events

Name Event Arguments DeclaringType Summary
Public EventStreamLoading StreamLoadingEventArgs This event allows you to pass in your own stream to represent the GeoImage.

Public Constructors

GeoImage()

This is the constructor used to create a new GeoImage.

Overloads

This constructor allows you to create a drawing image without specifying a PathFileName.

Remarks

You need to set the PathFileName if you intend to use this constructor.

Parameters

Name Type Description

Go Back

GeoImage(String)

This is the constructor to create a new GeoImage

Overloads

This constructor allows you to create a drawing image by specifying a PathFileName.

Remarks

When you specify the path and filename, it should be in the correct format as such; however, the file does not need to exist on the file system. This is to allow us to accept streams supplied by the developer at runtime. If you choose to provide a file that exists, then we will attempt to use it. If we cannot find it, then we will raise the SteamLoading event and allow you to supply the stream. For example, you can pass in “C:\NotARealPath\File1.ecw”, which does not exist on the file system. When we raise the event for you to supply a stream, we will pass to you the path and filename so you can differentiate the files.

Parameters

Name Type Description
pathFileName String<!– System.String –> The path and filename of the image file. Note that this need not actually exisit on the file system; see remarks below.

Go Back

GeoImage(Stream)

This is the constructor to create a new GeoImage.

Overloads

This overload allows you to pass in a stream, as long as it is in TIFF format.

Remarks

If you have a stream or an image in TIFF format, you can use this constructor to create a GeoImage from it.

Parameters

Name Type Description
imageStream Stream<!– System.IO.Stream –> This parameter must be a stream in TIFF format.

Go Back

GeoImage(Int32, Int32)

This is the constructor to create a new GeoImage

Overloads

This constructor allows you to create a GeoImage by specifying a width, height and a GeoCanvas.

Remarks

You can use this overload when you want to create a new GeoImage and only want to specify the width and height. You also need to pass in a GeoCanvas that will be used to create the GeoImage.

Parameters

Name Type Description
width Int32<!– System.Int32 –> This parameter is the width in pixels for the new GeoImage.
height Int32<!– System.Int32 –> This parameter is the height in pixels for the new GeoImage.

Go Back

Protected Constructors

Public Methods

Close()

This method closes the GeoImage. It is the same as calling the Dispose.

Remarks

This method closes the GeoImage. It is the same as calling the Dispose.

Return Value

Return Type Description
Void<!– System.Void –>

Parameters

Name Type Description

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

Dispose()

This is the Dispose for the class.

Overloads

This overload will dispose of the stream in the GeoImage and release its resources.

Remarks

This overload will dispose of the stream in the GeoImage and release its resources.

Return Value

Return Type Description
Void<!– System.Void –>

Parameters

Name Type Description

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

Equals(Object)

Return Value

Return Type Description
Boolean<!– System.Boolean –>

Parameters

Name Type Description
obj Object<!– System.Object –>

<!– System.Object –> Go Back

GetHashCode()

Return Value

Return Type Description
Int32<!– System.Int32 –>

Parameters

Name Type Description

<!– System.Object –> Go Back

GetHeight()

This method gets the height (in pixels) of this image.

Return Value

Return Type Description
Int32<!– System.Int32 –> This method returns the height (in pixels) of this image.

Parameters

Name Type Description

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

GetImageStream(GeoCanvas)

This method returns the stream of the GeoImage.

Remarks

This method will raise the event that allows the user to supply their own stream. The event is also raised if they do not attempt to open the file specified in the PathFileName property.

Return Value

Return Type Description
Stream<!– System.IO.Stream –> This method returns the stream of the GeoImage.

Parameters

Name Type Description
canvas GeoCanvas<!– ThinkGeo.MapSuite.Core.GeoCanvas –>

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

GetType()

Return Value

Return Type Description
Type<!– System.Type –>

Parameters

Name Type Description

<!– System.Object –> Go Back

GetWidth()

This method gets the width (in pixels) of this image.

Return Value

Return Type Description
Int32<!– System.Int32 –> This method returns the width (in pixels) of this image.

Parameters

Name Type Description

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

ToString()

Return Value

Return Type Description
String<!– System.String –>

Parameters

Name Type Description

<!– System.Object –> Go Back

Protected Methods

Finalize()

This is the Dispose method for the class.

Return Value

Return Type Description
Void<!– System.Void –>

Parameters

Name Type Description

<!– System.Object(overriden) –> Go Back

GetImageStreamCore(GeoCanvas)

This method returns the stream of the GeoImage.

Remarks

This method will raise the event that allows the user to supply their own stream. The event is also raised if they do not attempt to open the file specified in the PathFileName property.

Return Value

Return Type Description
Stream<!– System.IO.Stream –> This method returns the stream of the GeoImage.

Parameters

Name Type Description
canvas GeoCanvas<!– ThinkGeo.MapSuite.Core.GeoCanvas –>

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

MemberwiseClone()

Return Value

Return Type Description
Object<!– System.Object –>

Parameters

Name Type Description

<!– System.Object –> Go Back

OnStreamLoading(StreamLoadingEventArgs)

This method raises the StreamLoading event, allowing you to specify your own stream.

Return Value

Return Type Description
Void<!– System.Void –>

Parameters

Name Type Description
e StreamLoadingEventArgs<!– ThinkGeo.MapSuite.Core.StreamLoadingEventArgs –> This parameter represents the event arguments for the StreamLoading event.

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

Public Properties

CanvasImageFormat

This property returns the image format.

Return Value

Return Type
Guid<!– System.Guid –>

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

FileName

This property returns the filename part of the PathFileName.

Return Value

Return Type
String<!– System.String –>

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

PathFilename

This property returns the path and filename of the image you want to represent.

Remarks

When you specify the path and filename, it should be in the correct format as such; however, the file does not need to exist on the file system. This is to allow us to accept streams supplied by the developer at runtime. If you choose to provide a file that exists, then we will attempt to use it. If we cannot find it, then we will raise the SteamLoading event and allow you to supply the stream. For example, you can pass in “C:\NotARealPath\File1.ecw”, which does not exist on the file system. When we raise the event for you to supply a stream, we will pass to you the path and filename so you can differentiate the files.

Return Value

Return Type
String<!– System.String –>

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

PathName

This property returns the path part of the PathFileName.

Return Value

Return Type
String<!– System.String –>

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

Protected Properties

Public Events

StreamLoading

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

Remarks

If you choose, you can pass in your own stream to represent the GeoImage. The stream can come from a variety of places, such as isolated storage, a compressed file, or an encrypted stream. When the GeoImage 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 GeoImage will attempt to load the file from the file system using the PathFileName property.

Event Arguments

Event Arguments
StreamLoadingEventArgs<!– ThinkGeo.MapSuite.Core.StreamLoadingEventArgs –>

<!– ThinkGeo.MapSuite.Core.GeoImage –> Go Back

NOTOC MapSuiteCore ThinkGeo.MapSuite.Core UpdateDocumentation

thinkgeo.mapsuite.core.geoimage.1440040128.txt.gz · Last modified: 2015/09/17 09:01 (external edit)