Functions | Properties
Image common
Image modules

Functions

bool Image.Clear (uint CanvasColor, ICallback cBack)
 Clears the image using the specified canvas color as the new color for every pixel in the image.
bool Image.Close ()
 Closes the image.
bool Image.CreateNew (int NewWidth, int NewHeight)
 Creates a new image with specified width and height.
void Image.Deserialize (string newVal)
 Restores the properties of the image object from the serialized string.
string Image.get_ErrorMsg (int ErrorCode)
 Retrieves the error message associated with the specified error code.
bool Image.Open (string ImageFileName, ImageType fileType, bool InRam, ICallback cBack)
 Opens an image from file.
bool Image.Resource (string newImgPath)
 Changes the data source of the image object without the its closing.
bool Image.Save (string ImageFileName, bool WriteWorldFile, ImageType fileType, ICallback cBack)
 Saves the image to file.
string Image.Serialize (bool SerializePixels)
 Serializes the image properties to the string.

Properties

bool Image.CanUseGrouping [get, set]
 Gets or sets a boolean value which indicates how images with identical size and position on the map will be drawn.
string Image.CdlgFilter [get]
 Returns the common dialog filter containing all supported file extensions in string format.
int Image.FileHandle [get]
 Returns file handle for BMP image. For inner use only.
string Image.Filename [get]
 The filename associated with the object.
GeoProjection Image.GeoProjection [get]
 Get or sets an instance of GeoProjection class associated with the image.
ICallback Image.GlobalCallback [get, set]
 The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
ImageType Image.ImageType [get]
 Gets the image object's image type.
bool Image.IsEmpty [get]
 Returns true if image object is empty, i.e. not bound to some disk-based datasource and doesn't hold any in-memory data. This property is the same as checking Image.SourceType = istUninitialized.
bool Image.IsInRam [get]
 Returns true when the image is loaded in RAM memory, and returns false when the image is not loaded in RAM memory.
string Image.Key [get, set]
 The key may be used by the programmer to store any string data associated with the object.
Labels Image.Labels [get, set]
 Gets or sets instance of the labels class associated with the image.
int Image.LastErrorCode [get]
 Retrieves the last error generated in the object.
string Image.SourceFilename [get]
 Returns the filename of the datasource for an image.
tkImageSourceType Image.SourceType [get]
 The source type of the image.

Detailed Description

Here is a list of methods and properties that are common for all images despite their source. The properties and methods described here belong to Image class.

dot_inline_dotgraph_14.png

Graph description


Function Documentation

bool Image.Clear ( uint  CanvasColor,
ICallback  cBack 
)

Clears the image using the specified canvas color as the new color for every pixel in the image.

Parameters:
CanvasColorThe color to be used to as the new color of every pixel in the image. This is a UInt32 representation of an RGB value.
cBackOptional. The ICallback object that will receive the progress and error events while the image is cleared.
Returns:
A boolean value representing the success or failure of clearing the image.
bool Image.Close ( )

Closes the image.

Returns:
True on successful release of the resources and false otherwise. This value can be omitted.
Examples:
MarkPoints.cs.
bool Image.CreateNew ( int  NewWidth,
int  NewHeight 
)

Creates a new image with specified width and height.

Parameters:
NewWidthThe width of the new image in pixels.
NewHeightThe height of the new image in pixels.
Returns:
A boolean value representing the success or failure of creating the new image.
void Image.Deserialize ( string  newVal)

Restores the properties of the image object from the serialized string.

Parameters:
newValThe serialized string generated by Image.Serialize() method.
New API 4.8:
Added in version 4.8
string Image.get_ErrorMsg ( int  ErrorCode)

Retrieves the error message associated with the specified error code.

Parameters:
ErrorCodeThe error code for which the error message is required.
Returns:
The error message description for the specified error code.
bool Image.Open ( string  ImageFileName,
ImageType  fileType,
bool  InRam,
ICallback  cBack 
)

Opens an image from file.

Parameters:
ImageFileNameThe filename of the image to be opened.
fileTypeOptional. The type of image being opened. The default is "USE_FILE_EXTENSION".
InRamOptional. A boolean value representing whether the image is stored in RAM memory while open. The default is false. The settings affects only BMP images, as other image types are handled by GDAL. Image.IsInRam property will be set to true for them, but only memory will only hold a buffer currently displayed on screen.
cBackOptional. The ICallback object which will receive progress and error events while the image is being opened.
Returns:
A boolean value representing the success or failure of opening the image.
Examples:
AddLayers.cs, ImageLabels.cs, MarkPoints.cs, and PointIcons.cs.
bool Image.Resource ( string  newImgPath)

Changes the data source of the image object without the its closing.

Parameters:
newImgPathThe new file to serve as a datasource for the image object.
Returns:
True on success and false otherwise.
bool Image.Save ( string  ImageFileName,
bool  WriteWorldFile,
ImageType  fileType,
ICallback  cBack 
)

Saves the image to file.

Parameters:
ImageFileNameThe filename to use to save the image.
WriteWorldFileOptional. A boolean value representing whether a world file is also written. The default is false.
fileTypeOptional. The file type to use to save the image. Default is "USE_FILE_EXTENSION".
cBackOptional. The ICallback object which will receive the progress and error messages while the image is being saved.
Returns:
A boolean value representing the success or failure of saving the image.
string Image.Serialize ( bool  SerializePixels)

Serializes the image properties to the string.

Parameters:
SerializePixelsA boolean value which indicates whether image pixels should be serialized.
Returns:
The serialized string.
New API 4.8:
Added in version 4.8

Properties

bool Image.CanUseGrouping [get, set]

Gets or sets a boolean value which indicates how images with identical size and position on the map will be drawn.

When set to true such images will be merged into a single bitmap. This may improve performance in case of low number of data pixels (those which differ from the transparent color). The default value is false.

New API 4.8:
Added in version 4.8
string Image.CdlgFilter [get]

Returns the common dialog filter containing all supported file extensions in string format.

Examples:
ImageLabels.cs.
int Image.FileHandle [get]

Returns file handle for BMP image. For inner use only.

string Image.Filename [get]

The filename associated with the object.

Get or sets an instance of GeoProjection class associated with the image.

The property can't be set to NULL (there is always an instance of GeoProjection class associated with image).

New API 4.9.3:
Added in version 4.9.3

The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.

Deprecated:
v4.9.3 Use GlobalSettings.ApplicationCallback instead.

Gets the image object's image type.

bool Image.IsEmpty [get]

Returns true if image object is empty, i.e. not bound to some disk-based datasource and doesn't hold any in-memory data. This property is the same as checking Image.SourceType = istUninitialized.

bool Image.IsInRam [get]

Returns true when the image is loaded in RAM memory, and returns false when the image is not loaded in RAM memory.

string Image.Key [get, set]

The key may be used by the programmer to store any string data associated with the object.

Labels Image.Labels [get, set]

Gets or sets instance of the labels class associated with the image.

New API 4.8:
Added in version 4.8
Examples:
ImageLabels.cs.

Retrieves the last error generated in the object.

Examples:
AddLayers.cs, and MarkPoints.cs.
string Image.SourceFilename [get]

Returns the filename of the datasource for an image.

For proxy image grid filename will be renamed, in other cases Filename of Image itself.

New API 4.9.1:
Added in version 4.9.1

The source type of the image.

Images start with istUninitialized state. After loading bmp images istDiskBased or istInMemory value will be set depending on the value of inMem parameter. For GDAL images istGDALBased will be set.

New API 4.8:
Added in version 4.8
 All Classes Files Functions Enumerations Properties Events