User Tools

Site Tools


thinkgeo.mapsuite.core.gdiplusrastersource

This is an old revision of the document!


Table of Contents

ThinkGeo.MapSuite.Core.GdiPlusRasterSource

<!– Class –> This class allows you to view standard .NET GDI+ image types such as BMP, TIF, JPG, and PNG.

Remarks

This class handles all default supported image types of GDI+. 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.

Inheritance Hierarchy

Members Summary

Public Constructors

Name Parameters DeclaringType Summary
Public MethodGdiPlusRasterSource This is the constructor the for the class.
Public MethodGdiPlusRasterSource String This is the constructor the for the class.
Public MethodGdiPlusRasterSource String, String This is the constructor the for the class.
Public MethodGdiPlusRasterSource String, RectangleShape This is the constructor the for the class.

Protected Constructors

Name Parameters DeclaringType Summary

Public Methods

Name Parameters DeclaringType Summary
Public MethodCloneDeep RasterSource Create a copy of RasterSource using the deep clone process.
Public MethodClose RasterSource This method closes the RasterSource and releases any resources it was using.
Public MethodEquals Object Object
Public MethodStatic MemberGenerateWorldFileText RectangleShape, Int32, Int32 RasterSource This method returns a string that represents the image's world file based on the parameters passed in.
Public MethodGetBoundingBox RasterSource This method returns the bounding box of the RasterSource.
Public MethodGetHashCode Object
Public MethodGetHorizontalResolution RasterSource This method returns the horizontal resolution of the image.
Public MethodGetImage RectangleShape, Int32, Int32 RasterSource This method returns an image based on the worldExtent and image width and height.
Public MethodGetImageHeight RasterSource This method returns the height of the image in screen coordinates.
Public MethodGetImageWidth RasterSource This method returns the width of the image in screen coordinates.
Public MethodGetProjectionText RasterSource This method returns the projection text in proj4 format.
Public MethodGetType Object
Public MethodGetVerticalResolution RasterSource This method returns the vertical resolution of the image.
Public MethodGetWorldFileText RasterSource This method returns a string that represents the image's world file.
Public MethodOpen RasterSource This method opens the RasterSource so that it is initialized and ready to use.
Public MethodToString Object

Protected Methods

Name Parameters DeclaringType Summary
Protected MethodCloneDeepCore RasterSource Create a copy of RasterSource using the deep clone process. The default implementation uses serialization.
Protected MethodCloseCore RasterSource(overriden) This method opens the ImageSource so that it is initialized and ready to use.
Protected MethodFinalize Object
Protected MethodGetBoundingBoxCore RasterSource(overriden) This method returns the bounding box of the RasterSource.
Protected MethodGetImageCore RectangleShape, Int32, Int32 RasterSource(overriden) This method returns an image based on the worldExtent, image width and image height.
Protected MethodGetImageHeightCore RasterSource(overriden) This method returns the height of the image in screen coordinates.
Protected MethodGetImageWidthCore RasterSource(overriden) This method returns the width of the image in screen coordinates.
Protected MethodGetProjectionTextCore RasterSource This method returns the projection text in proj4 format.
Protected MethodMemberwiseClone Object
Protected MethodOnClosedRasterSource ClosedRasterSourceEventArgs RasterSource This method allows you to raise the ClosedRasterSource event from a derived class.
Protected MethodOnClosingRasterSource ClosingRasterSourceEventArgs RasterSource This method allows you to raise the ClosingRasterSource event from a derived class.
Protected MethodOnOpenedRasterSource OpenedRasterSourceEventArgs RasterSource This method allows you to raise the OpenedRasterSource event from a derived class.
Protected MethodOnOpeningRasterSource OpeningRasterSourceEventArgs RasterSource This method allows you to raise the OpeningRasterSource event from a derived class.
Protected MethodOnStreamLoading StreamLoadingEventArgs This method allows you to raise the StreamLoading event.
Protected MethodOpenCore RasterSource(overriden) This method opens the ImageSource so that it is initialized and ready to use.

Public Properties

Name Return DeclaringType Summary
Public PropertyBlueTranslation Single RasterSource This property gets and sets the amount of blue to apply to the image.
Public PropertyFileName String This property returns the filename part of the PathFileName.
Public PropertyFilePath String This property returns the path part of the PathFileName.
Public PropertyGreenTranslation Single RasterSource This property gets and sets the amount of green to apply to the image.
Public PropertyHasProjectionText Boolean RasterSource This property returns true if the RasterSource has projection text, false if not.
Public PropertyIsGrayscale Boolean This property gets and sets whether the image shows in grayscale.
Public PropertyIsNegative Boolean This property gets and sets whether the image shows as negative (inverted colors).
Public PropertyIsOpen Boolean RasterSource This property returns true if the RasterSource is open and false if it is not.
Public PropertyPathFilename String This property returns the path and filename of the image you want to represent.
Public PropertyProjection Projection RasterSource
Public PropertyRedTranslation Single RasterSource This property gets and sets the amount of red to apply to the image.
Public PropertyTransparency Single RasterSource This property gets and sets the amount of transparency to apply to the image.

Protected Properties

Name Return DeclaringType Summary
Protected PropertyHasProjectionTextCore Boolean RasterSource This property returns true if the RasterSource has projection text, false if not.

Public Events

Name Event Arguments DeclaringType Summary
Public EventClosedRasterSource ClosedRasterSourceEventArgs RasterSource This event is called after the closing of the RasterSource.
Public EventClosingRasterSource ClosingRasterSourceEventArgs RasterSource This event is called before the closing of the RasterSource.
Public EventOpenedRasterSource OpenedRasterSourceEventArgs RasterSource This event is called after the opening of the RasterSource.
Public EventOpeningRasterSource OpeningRasterSourceEventArgs RasterSource This event is called before the opening of the RasterSource.
Public EventStreamLoading StreamLoadingEventArgs This event allows you to pass in your own stream to represent the image.

Public Constructors

GdiPlusRasterSource()

This is the constructor the for the class.

Overloads

This is the default constructor.

Parameters

Name Type Description

Go Back

GdiPlusRasterSource(String)

This is the constructor the for the class.

Overloads

This constructor allows you to pass in a path and filename for the image you want to load.

Remarks

You can specify a path and filename that does not actually exist if you use the StreamLoading event. This event only uses the PathFileName parameter as a unique string that will be passed to you in the event, so that you can determine what stream you want to pass back.

Parameters

Name Type Description
imagePathFilename String<!– System.String –> This parameter represents the image you want to load.

Go Back

GdiPlusRasterSource(String, String)

This is the constructor the for the class.

Overloads

This constructor allows you to pass in a path and filename, and a world file path and filename, for the image you want to load.

Remarks

You can specify a path and filename that does not actually exist if you use the StreamLoading event. This event only uses the PathFileName parameter as a unique string that will be passed to you in the event, so that you can determine what stream you want to pass back.

Parameters

Name Type Description
imagePathFilename String<!– System.String –> This parameter represents the image you want to load.
worldfilePathFilename String<!– System.String –> This parameter represents the world file path and filename you want to load.

Go Back

GdiPlusRasterSource(String, RectangleShape)

This is the constructor the for the class.

Overloads

This constructor allows you to pass in a path, filename and extent for the image you want to load.

Remarks

You can specify a path and filename that does not actually exist if you use the StreamLoading event. This event only uses the PathFileName parameter as a unique string that will be passed to you in the event, so that you can determine what stream you want to pass back.

Parameters

Name Type Description
imagePathFilename String<!– System.String –> This parameter represents the image you want to load.
imageExtent RectangleShape<!– ThinkGeo.MapSuite.Core.RectangleShape –> This parameter represents the extnet of the image you want to load.

Go Back

Protected Constructors

Public Methods

CloneDeep()

Create a copy of RasterSource using the deep clone process.

Remarks

The difference between deep clone and shallow clone is: when shallow cloned, only the object is copied, but the contained objects are not; while in deep clone it does copy the cloned object as well as all the objects within.

Return Value

Return Type Description
RasterSource<!– ThinkGeo.MapSuite.Core.RasterSource –> A cloned RasterSource.

Parameters

Name Type Description

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

Close()

This method closes the RasterSource and releases any resources it was using.

Remarks

This method is the concrete wrapper for the abstract method CloseCore. The Close method plays an important role in the life cycle of the RasterSource. It may be called after drawing to release any memory and other resources that were allocated since the Open method was called.

If you override the Core version of this method, it is recommended that you take the following things into account: This method may be called multiple times, so we suggest you write the method so that that a call to a closed RasterSource is ignored and does not generate an error. We also suggest that in the Close you free all resources that have been opened. Remember that the object will not be destroyed, but will be re-opened possibly in the near future.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

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

Parameters

Name Type Description

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

Equals(Object)

Return Value

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

Parameters

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

<!– System.Object –> Go Back

GenerateWorldFileText(RectangleShape, Int32, Int32)

<!– static –> This method returns a string that represents the image's world file based on the parameters passed in.

Remarks

This method returns a string that represents the image's world file. The world file is a file type that can accompany image files. It contains information about the image's position, resolution and other spatial-related items. It is common to have this kind of file associated with generic image types such as JPG, BMP, and normal TIFF because they do not have a mechanism to store this data internally. Modern GIS image types such as JPEG2000, ECW, and MrSid typically have this information stored internally. We provide this method in the event that you want to create your own world file from any image that either already has one or has its data stored internally.

Return Value

Return Type Description
String<!– System.String –> This method returns a string that represents the image's world file based on the parameters passed in.

Parameters

Name Type Description
worldExtent RectangleShape<!– ThinkGeo.MapSuite.Core.RectangleShape –> This parameter represents the worldExtent of the image in world coordinates.
imageWidth Int32<!– System.Int32 –> This parameter is the width of the image in screen coordinates.
imageHeight Int32<!– System.Int32 –> This parameter is the height of the image in screen coordinates.

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

GetBoundingBox()

This method returns the bounding box of the RasterSource.

Remarks

This method returns the bounding box of the RasterSource.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

Return Type Description
RectangleShape<!– ThinkGeo.MapSuite.Core.RectangleShape –> This method returns the bounding box of the RasterSource.

Parameters

Name Type Description

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

GetHashCode()

Return Value

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

Parameters

Name Type Description

<!– System.Object –> Go Back

GetHorizontalResolution()

This method returns the horizontal resolution of the image.

Remarks

This method returns the horizontal resolution of the image.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

Return Type Description
Single<!– System.Single –> This method returns the horizontal resolution of the image.

Parameters

Name Type Description

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

GetImage(RectangleShape, Int32, Int32)

This method returns an image based on the worldExtent and image width and height.

Remarks

This method is responsible for returning the image based on the parameters passed in. As the core version of this method is abstract, you will need to override it when creating your own RasterSource.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

Return Type Description
GeoImage<!– ThinkGeo.MapSuite.Core.GeoImage –> This method returns an image based on the worldExtent and image width and height.

Parameters

Name Type Description
worldExtent RectangleShape<!– ThinkGeo.MapSuite.Core.RectangleShape –> This parameter represents the worldExtent you want to draw.
canvasWidth Int32<!– System.Int32 –> This parameter represents the width of the image you want to draw.
canvasHeight Int32<!– System.Int32 –> This parameter represents the height of the image you want to draw.

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

GetImageHeight()

This method returns the height of the image in screen coordinates.

Remarks

This method returns the height of the image in screen coordinates.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

Return Type Description
Int32<!– System.Int32 –> This method returns the height of the image in screen coordinates.

Parameters

Name Type Description

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

GetImageWidth()

This method returns the width of the image in screen coordinates.

Remarks

This method returns the width of the image in screen coordinates.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

Return Type Description
Int32<!– System.Int32 –> This method returns the width of the image in screen coordinates.

Parameters

Name Type Description

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

GetProjectionText()

This method returns the projection text in proj4 format.

Return Value

Return Type Description
String<!– System.String –> This method returns the projection text in proj4 format.

Parameters

Name Type Description

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

GetType()

Return Value

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

Parameters

Name Type Description

<!– System.Object –> Go Back

GetVerticalResolution()

This method returns the vertical resolution of the image.

Remarks

This method returns the vertical resolution of the image.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

Return Type Description
Single<!– System.Single –> This method returns the vertical resolution of the image.

Parameters

Name Type Description

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

GetWorldFileText()

This method returns a string that represents the image's world file.

Remarks

This method wraps the Core version of this method and returns a string that represents the image's world file. The world file is a file type that can accompany image files. It contains information about the image's position, resolution and other spatial-related items. It is common to have this kind of file associated with generic image types such as JPG, BMP, and normal TIFF because they do not have a mechanism to store this data internally. Modern GIS image types such as JPEG2000, ECW, and MrSid typically have this information stored internally. We provide this method in the event that you want to create your own world file from any image that either already has one or has its data stored internally.

As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

Return Type Description
String<!– System.String –> This method returns a string that represents the image's world file.

Parameters

Name Type Description

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

Open()

This method opens the RasterSource so that it is initialized and ready to use.

Remarks

This method is the concrete wrapper for the abstract method OpenCore. The Open method plays an important role, as it is responsible for initializing the RasterSource. Most methods on the RasterSource will throw an exception if the state of the RasterSource is not opened. When the map draws each layer, it will open the RasterSource as one of its first steps; then, after it is finished drawing with that layer, it will close it. In this way, we are sure to release all resources used by the RasterSource.

When implementing the abstract method, consider opening files for file-based sources, connecting to databases in the database-based sources and so on. You will get a chance to close these in the Close method of the RasterSource. As this is a concrete public method that wraps a Core method, we reserve the right to add events and other logic to pre- or post-process data returned by the Core version of the method. In this way, we leave our framework open on our end, but also allow you the developer to extend our logic to suit your needs. If you have questions about this, please contact our support team as we would be happy to work with you on extending our framework.

Return Value

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

Parameters

Name Type Description

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

ToString()

Return Value

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

Parameters

Name Type Description

<!– System.Object –> Go Back

Protected Methods

CloneDeepCore()

Create a copy of RasterSource using the deep clone process. The default implementation uses serialization.

Remarks

The difference between deep clone and shallow clone is: when shallow cloned, only the object is copied, but the contained objects are not; while in deep clone it does copy the cloned object as well as all the objects within.

Return Value

Return Type Description
RasterSource<!– ThinkGeo.MapSuite.Core.RasterSource –> A cloned RasterSource.

Parameters

Name Type Description

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

CloseCore()

This method opens the ImageSource so that it is initialized and ready to use.

Remarks

This protected virtual method is called from the concrete public method Close. The Close method plays an important role in the life cycle of the ImageSource. It may be called after drawing to release any memory and other resources that were allocated since the Open method was called.

If you override this method, it is recommended that that you take the following things into account: This method may be called multiple times, so we suggest you write the method so that that a call to a closed FeatureSource is ignored and does not generate an error. We also suggest that in the Close you free all resources that have been opened. Remember that the object will not be destroyed, but will be re-opened possibly in the near future.

Return Value

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

Parameters

Name Type Description

<!– ThinkGeo.MapSuite.Core.RasterSource(overriden) –> Go Back

Finalize()

Return Value

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

Parameters

Name Type Description

<!– System.Object –> Go Back

GetBoundingBoxCore()

This method returns the bounding box of the RasterSource.

Remarks

This method returns the bounding box of the RasterSource.

Return Value

Return Type Description
RectangleShape<!– ThinkGeo.MapSuite.Core.RectangleShape –> This method returns the bounding box of the RasterSource.

Parameters

Name Type Description

<!– ThinkGeo.MapSuite.Core.RasterSource(overriden) –> Go Back

GetImageCore(RectangleShape, Int32, Int32)

This method returns an image based on the worldExtent, image width and image height.

Remarks

This method is responsible for returning the image based on the parameters passed in.

Return Value

Return Type Description
GeoImage<!– ThinkGeo.MapSuite.Core.GeoImage –> This method returns an image based on the worldExtent, image width and image height.

Parameters

Name Type Description
worldExtent RectangleShape<!– ThinkGeo.MapSuite.Core.RectangleShape –> This parameter represents the worldExtent you want to draw.
canvasWidth Int32<!– System.Int32 –> This parameter represents the width of the image you want to draw.
canvasHeight Int32<!– System.Int32 –> This parameter represents the height of the image you want to draw.

<!– ThinkGeo.MapSuite.Core.RasterSource(overriden) –> Go Back

GetImageHeightCore()

This method returns the height of the image in screen coordinates.

Remarks

This method returns the height of the image in screen coordinates.

Return Value

Return Type Description
Int32<!– System.Int32 –> This method returns the height of the image in screen coordinates.

Parameters

Name Type Description

<!– ThinkGeo.MapSuite.Core.RasterSource(overriden) –> Go Back

GetImageWidthCore()

This method returns the width of the image in screen coordinates.

Remarks

This method returns the width of the image in screen coordinates.

Return Value

Return Type Description
Int32<!– System.Int32 –> This method returns the width of the image in screen coordinates.

Parameters

Name Type Description

<!– ThinkGeo.MapSuite.Core.RasterSource(overriden) –> Go Back

GetProjectionTextCore()

This method returns the projection text in proj4 format.

Remarks

This protected virtual method is called from the concrete public method GetProjectionText.

The default implementation of this core method is to throw an exception. So you need to overwrite this method to return the RasterSource projection text.

Return Value

Return Type Description
String<!– System.String –> Projection text string.

Parameters

Name Type Description

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

MemberwiseClone()

Return Value

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

Parameters

Name Type Description

<!– System.Object –> Go Back

OnClosedRasterSource(ClosedRasterSourceEventArgs)

This method allows you to raise the ClosedRasterSource event from a derived class.

Remarks

You can call this method from a derived class to enable it to raise the ClosedRasterSource event. This may be useful if you plan to extend the RasterSource and you need access to the event.

Details on the event:

This event is called after the closing of the RasterSource. Technically, this event is called after the calling of the Close method on the RasterSource and after the protected CloseCore method.

It is typical that the RasterSource may be opened and closed may times during the life cycle of your application. The type of control the MapEngine is embedded in will dictate how often this happens. For example, in the case of the Web Edition, each time a RasterSource is in the Ajax or Post Back part of the page cycle, it will close the RasterSource before returning back to the client. This is to conserve resources, as the web is a connection-less environment. In the case of the Desktop Edition, we can keep the RasterSource open, knowing that we can maintain a persistent connection.

Return Value

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

Parameters

Name Type Description
e ClosedRasterSourceEventArgs<!– ThinkGeo.MapSuite.Core.ClosedRasterSourceEventArgs –> This parameter is the event arguments that define the parameters passed to the recipient of the event.

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

OnClosingRasterSource(ClosingRasterSourceEventArgs)

This method allows you to raise the ClosingRasterSource event from a derived class.

Remarks

You can call this method from a derived class to enable it to raise the ClosingRasterSource event. This may be useful if you plan to extend the RasterSource and you need access to the event.

Details on the event:

This event is called before the closing of the RasterSource. Technically, this event is called after the calling of the Close method on the RasterSource, but before the protected CloseCore method.

It is typical that the RasterSource may be opened and closed may times during the life cycle of your application. The type of control the MapEngine is embedded in will dictate how often this happens. For example, in the case of the Web Edition, each time a RasterSource is in the Ajax or Post Back part of the page cycle, it will close the RasterSource before returning back to the client. This is to conserve resources, as the web is a connection-less environment. In the case of the Desktop Edition, we can keep the RasterSource open, knowing that we can maintain a persistent connection.

Return Value

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

Parameters

Name Type Description
e ClosingRasterSourceEventArgs<!– ThinkGeo.MapSuite.Core.ClosingRasterSourceEventArgs –> This parameter is the event arguments that define the parameters passed to the recipient of the event.

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

OnOpenedRasterSource(OpenedRasterSourceEventArgs)

This method allows you to raise the OpenedRasterSource event from a derived class.

Remarks

You can call this method from a derived class to enable it to raise the OpenedRasterSource event. This may be useful if you plan to extend the RasterSource and you need access to the event.

Details on the event:

This event is called after the opening of the RasterSource. Technically, this event is called after the calling of the Open method on the RasterSource and after the protected OpenCore method is called.

It is typical that the RasterSource may be opened and closed may times during the life cycle of your application. The type of control the MapEngine is embedded in will dictate how often this happens. For example, in the case of the Web Edition, each time a RasterSource is in the Ajax or Post Back part of the page cycle, it will close the RasterSource before returning back to the client. This is to conserve resources, as the web is a connection-less environment. In the case of the Desktop Edition, we can keep the RasterSource open, knowing that we can maintain a persistent connection.

Return Value

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

Parameters

Name Type Description
e OpenedRasterSourceEventArgs<!– ThinkGeo.MapSuite.Core.OpenedRasterSourceEventArgs –> This parameter is the event arguments that define the parameters passed to the recipient of the event.

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

OnOpeningRasterSource(OpeningRasterSourceEventArgs)

This method allows you to raise the OpeningRasterSource event from a derived class.

Remarks

You can call this method from a derived class to enable it to raise the OpeningRasterSource event. This may be useful if you plan to extend the RasterSource and you need access to the event.

Details on the event:

This event is called before the opening of the RasterSource. Technically, this event is called after the calling of the Open method on the RasterSource, but before the protected OpenCore method.

It is typical that the RasterSource may be opened and closed may times during the life cycle of your application. The type of control the MapEngine is embedded in will dictate how often this happens. For example, in the case of the Web Edition, each time a RasterSource is in the Ajax or Post Back part of the page cycle, it will close the RasterSource before returning back to the client. This is to conserve resources, as the web is a connection-less environment. In the case of the Desktop Edition, we can keep the RasterSource open, knowing that we can maintain a persistent connection.

Return Value

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

Parameters

Name Type Description
e OpeningRasterSourceEventArgs<!– ThinkGeo.MapSuite.Core.OpeningRasterSourceEventArgs –> This parameter is the event arguments that define the parameters passed to the recipient of the event.

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

OnStreamLoading(StreamLoadingEventArgs)

This method allows you to raise the StreamLoading event.

Remarks

This method allows you to raise the StreamLoading event. Normally events are not accessible to derived classes, so we exposed a way to raise the event as necessary through this protected method.

Return Value

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

Parameters

Name Type Description
e StreamLoadingEventArgs<!– ThinkGeo.MapSuite.Core.StreamLoadingEventArgs –> This parameter represents the event arguments you want to raise the StreamLoading event with.

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

OpenCore()

This method opens the ImageSource so that it is initialized and ready to use.

Remarks

This protected virtual method is called from the concrete public method Open. The Open method plays an important role, as it is responsible for initializing the ImageSource. Most methods on the ImageSource will throw an exception if the state of the ImageSource is not opened. When the map draws each layer, it will open the ImageSource as one of its first steps; then, after it is finished drawing with that layer, it will close it. In this way, we are sure to release all resources used by the ImageSource.

When implementing this abstract method, consider opening files for file-based sources, connecting to databases in the database-based sources and so on. You will get a chance to close these in the Close method of the ImageSource.

Return Value

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

Parameters

Name Type Description

<!– ThinkGeo.MapSuite.Core.RasterSource(overriden) –> Go Back

Public Properties

BlueTranslation

This property gets and sets the amount of blue to apply to the image.

Return Value

Return Type
Single<!– System.Single –>

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

FileName

This property returns the filename part of the PathFileName.

Return Value

Return Type
String<!– System.String –>

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

FilePath

This property returns the path part of the PathFileName.

Return Value

Return Type
String<!– System.String –>

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

GreenTranslation

This property gets and sets the amount of green to apply to the image.

Return Value

Return Type
Single<!– System.Single –>

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

HasProjectionText

This property returns true if the RasterSource has projection text, false if not.

Remarks

Before you call GetProjectionText method, you should check this property to ensure that your RasterSource has projection information. It will throw an exception if there is no projection information in the RasterSource.

Return Value

Return Type
Boolean<!– System.Boolean –>

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

IsGrayscale

This property gets and sets whether the image shows in grayscale.

Remarks

This property allows you to show the image in grayscale.

Return Value

Return Type
Boolean<!– System.Boolean –>

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

IsNegative

This property gets and sets whether the image shows as negative (inverted colors).

Remarks

You can set this property to show the negative of the image.

Return Value

Return Type
Boolean<!– System.Boolean –>

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

IsOpen

This property returns true if the RasterSource is open and false if it is not.

Remarks

Various methods on the RasterSource require that it be in an open state. If one of those methods is called when the state is not open, the method will throw an exception. To enter the open state, you must call the RasterSource's Open method. The method will raise an exception if the current RasterSource is already open.

Return Value

Return Type
Boolean<!– System.Boolean –>

<!– ThinkGeo.MapSuite.Core.RasterSource –> 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 actually 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, 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.jpg” 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.GdiPlusRasterSource –> Go Back

Projection

Return Value

Return Type
Projection<!– ThinkGeo.MapSuite.Core.Projection –>

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

RedTranslation

This property gets and sets the amount of red to apply to the image.

Return Value

Return Type
Single<!– System.Single –>

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

Transparency

This property gets and sets the amount of transparency to apply to the image.

Return Value

Return Type
Single<!– System.Single –>

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

Protected Properties

HasProjectionTextCore

This property returns true if the RasterSource has projection text, false if not.

Remarks

This protected virtual method is called from the concrete public property HasProjectionText. The default implementation for this method returns false. So if you inherit RasterSource, please ensure that you override this virtual property to return the correct projection status of your RasterSource.

We will check the HasProjectionText status before you call the GetProjectionText method. It will throw an exception if the HasProjectionText property returns false.

Return Value

Return Type
Boolean<!– System.Boolean –>

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

Public Events

ClosedRasterSource

This event is called after the closing of the RasterSource.

Remarks

This event is called after the closing of the RasterSource. Technically, this event is called after the calling of the Close method on the RasterSource and after the protected CloseCore method.

It is typical that the RasterSource may be opened and closed may times during the life cycle of your application. The type of control the MapEngine is embedded in will dictate how often this happens. For example, in the case of the Web Edition, each time a RasterSource is in the Ajax or Post Back part of the page cycle, it will close the RasterSource before returning back to the client. This is to conserve resources, as the web is a connection-less environment. In the case of the Desktop Edition, we can keep the RasterSource open, knowing that we can maintain a persistent connection.

Event Arguments

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

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

ClosingRasterSource

This event is called before the closing of the RasterSource.

Remarks

This event is called before the closing of the RasterSource. Technically, this event is called after the calling of the Close method on the RasterSource, but before the protected CloseCore method.

It is typical that the RasterSource may be opened and closed may times during the life cycle of your application. The type of control the MapEngine is embedded in will dictate how often this happens. For example, in the case of the Web Edition, each time a RasterSource is in the Ajax or Post Back part of the page cycle, it will close the RasterSource before returning back to the client. This is to conserve resources, as the web is a connection-less environment. In the case of the Desktop Edition, we can keep the RasterSource open, knowing that we can maintain a persistent connection.

Event Arguments

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

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

OpenedRasterSource

This event is called after the opening of the RasterSource.

Remarks

This event is called after the opening of the RasterSource. Technically, this event is called after the calling of the Open method on the RasterSource and after the protected OpenCore method is called.

It is typical that the RasterSource may be opened and closed may times during the life cycle of your application. The type of control the MapEngine is embedded in will dictate how often this happens. For example, in the case of the Web Edition, each time a RasterSource is in the Ajax or Post Back part of the page cycle, it will close the RasterSource before returning back to the client. This is to conserve resources, as the web is a connection-less environment. In the case of the Desktop Edition, we can keep the RasterSource open, knowing that we can maintain a persistent connection.

Event Arguments

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

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

OpeningRasterSource

This event is called before the opening of the RasterSource.

Remarks

This event is called before the opening of the RasterSource. Technically, this event is called after the calling of the Open method on the RasterSource, but before the protected OpenCore method.

It is typical that the RasterSource may be opened and closed may times during the life cycle of your application. The type of control the MapEngine is embedded in will dictate how often this happens. For example, in the case of the Web Edition, each time a RasterSource is in the Ajax or Post Back part of the page cycle, it will close the RasterSource before returning back to the client. This is to conserve resources, as the web is a connection-less environment. In the case of the Desktop Edition, we can keep the RasterSource open, knowing that we can maintain a persistent connection.

Event Arguments

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

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

StreamLoading

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

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.

Event Arguments

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

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

NOTOC MapSuiteCore ThinkGeo.MapSuite.Core UpdateDocumentation

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