User Tools

Site Tools


thinkgeo.mapsuite.portablecore.geoimage

This is an old revision of the document!


ThinkGeo.MapSuite.PortableCore.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
Public MethodGeoImage Object

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 MethodSave Stream, GeoImageFormat
Public MethodSave Stream
Public MethodToString Object

Protected Methods

Name Parameters DeclaringType Summary
Protected MethodCloneCore GeoImage
Protected MethodCreateCore Stream
Protected MethodCreateCore Single, Single
Protected MethodDisposeCore Object
Protected MethodFinalize Object(overriden) This is the Dispose method for the class.
Protected MethodGetHeightCore GeoImage
Protected MethodGetImageHeightCore Stream
Protected MethodGetImageStreamCore GeoCanvas This method returns the stream of the GeoImage.
Protected MethodGetImageWidthCore Stream
Protected MethodGetPixelCore GeoImage, Int32, Int32
Protected MethodGetWidthCore GeoImage
Protected MethodMemberwiseClone Object
Protected MethodOnStreamLoading StreamLoadingEventArgs This method raises the StreamLoading event, allowing you to specify your own stream.
Protected MethodSaveCore GeoImage, Stream, GeoImageFormat
Protected MethodSaveCore GeoImage, Stream, Guid, Guid, Int64
Protected MethodSetPixelCore GeoImage, Int32, Int32, GeoColor
Protected MethodSetResolutionCore GeoImage, Single, Single

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 PropertyNativeImage Object
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

GeoImage(Object)

Parameters

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

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.PortableCore.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.PortableCore.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.PortableCore.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.PortableCore.GeoCanvas –>

<!– ThinkGeo.MapSuite.PortableCore.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.PortableCore.GeoImage –> Go Back

Save(Stream, GeoImageFormat)

Return Value

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

Parameters

Name Type Description
stream Stream<!– System.IO.Stream –>
geoImageFormat GeoImageFormat<!– ThinkGeo.MapSuite.Portable.GeoImageFormat –>

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

Save(Stream)

Return Value

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

Parameters

Name Type Description
stream Stream<!– System.IO.Stream –>

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

ToString()

Return Value

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

Parameters

Name Type Description

<!– System.Object –> Go Back

Protected Methods

CloneCore(GeoImage)

Return Value

Return Type Description
GeoImage<!– ThinkGeo.MapSuite.PortableCore.GeoImage –>

Parameters

Name Type Description
image GeoImage<!– ThinkGeo.MapSuite.PortableCore.GeoImage –>

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

CreateCore(Stream)

Return Value

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

Parameters

Name Type Description
stream Stream<!– System.IO.Stream –>

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

CreateCore(Single, Single)

Return Value

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

Parameters

Name Type Description
width Single<!– System.Single –>
height Single<!– System.Single –>

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

DisposeCore(Object)

Return Value

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

Parameters

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

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

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

GetHeightCore(GeoImage)

Return Value

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

Parameters

Name Type Description
image GeoImage<!– ThinkGeo.MapSuite.PortableCore.GeoImage –>

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

GetImageHeightCore(Stream)

Return Value

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

Parameters

Name Type Description
imageStream Stream<!– System.IO.Stream –>

<!– ThinkGeo.MapSuite.PortableCore.GeoImage –> 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.PortableCore.GeoCanvas –>

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

GetImageWidthCore(Stream)

Return Value

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

Parameters

Name Type Description
imageStream Stream<!– System.IO.Stream –>

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

GetPixelCore(GeoImage, Int32, Int32)

Return Value

Return Type Description
GeoColor<!– ThinkGeo.MapSuite.PortableCore.GeoColor –>

Parameters

Name Type Description
image GeoImage<!– ThinkGeo.MapSuite.PortableCore.GeoImage –>
j Int32<!– System.Int32 –>
i Int32<!– System.Int32 –>

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

GetWidthCore(GeoImage)

Return Value

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

Parameters

Name Type Description
image GeoImage<!– ThinkGeo.MapSuite.PortableCore.GeoImage –>

<!– ThinkGeo.MapSuite.PortableCore.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.PortableCore.StreamLoadingEventArgs –> This parameter represents the event arguments for the StreamLoading event.

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

SaveCore(GeoImage, Stream, GeoImageFormat)

Return Value

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

Parameters

Name Type Description
image GeoImage<!– ThinkGeo.MapSuite.PortableCore.GeoImage –>
streamSource Stream<!– System.IO.Stream –>
imageFormat GeoImageFormat<!– ThinkGeo.MapSuite.Portable.GeoImageFormat –>

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

SaveCore(GeoImage, Stream, Guid, Guid, Int64)

Return Value

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

Parameters

Name Type Description
image GeoImage<!– ThinkGeo.MapSuite.PortableCore.GeoImage –>
stream Stream<!– System.IO.Stream –>
jpegCodecInfo Guid<!– System.Guid –>
encoderParameters Guid<!– System.Guid –>
jpegQuality Int64<!– System.Int64 –>

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

SetPixelCore(GeoImage, Int32, Int32, GeoColor)

Return Value

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

Parameters

Name Type Description
image GeoImage<!– ThinkGeo.MapSuite.PortableCore.GeoImage –>
x Int32<!– System.Int32 –>
y Int32<!– System.Int32 –>
color GeoColor<!– ThinkGeo.MapSuite.PortableCore.GeoColor –>

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

SetResolutionCore(GeoImage, Single, Single)

Return Value

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

Parameters

Name Type Description
image GeoImage<!– ThinkGeo.MapSuite.PortableCore.GeoImage –>
xDpi Single<!– System.Single –>
yDpi Single<!– System.Single –>

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

Public Properties

CanvasImageFormat

This property returns the image format.

Return Value

Return Type
Guid<!– System.Guid –>

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

FileName

This property returns the filename part of the PathFileName.

Return Value

Return Type
String<!– System.String –>

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

NativeImage

Return Value

Return Type
Object<!– System.Object –>

<!– ThinkGeo.MapSuite.PortableCore.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.PortableCore.GeoImage –> Go Back

PathName

This property returns the path part of the PathFileName.

Return Value

Return Type
String<!– System.String –>

<!– ThinkGeo.MapSuite.PortableCore.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.PortableCore.StreamLoadingEventArgs –>

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

NOTOC MapSuitePortableCore ThinkGeo.MapSuite.PortableCore UpdateDocumentation

thinkgeo.mapsuite.portablecore.geoimage.1440040132.txt.gz · Last modified: 2015/09/21 08:08 (external edit)