Image common

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. More...
 
bool Image.Close ()
 Closes the image. More...
 
bool Image.CreateNew (int NewWidth, int NewHeight)
 Creates a new image with specified width and height. More...
 
void Image.Deserialize (string NewVal)
 Restores the properties of the image object from the serialized string. More...
 
string Image.get_ErrorMsg (int ErrorCode)
 Retrieves the error message associated with the specified error code. More...
 
bool Image.Open (string ImageFileName, ImageType fileType, bool InRam, ICallback cBack)
 Opens an image from file. More...
 
bool Image.Resource (string NewImgPath)
 Changes the data source of the image object without the its closing. More...
 
bool Image.Save (string ImageFileName, bool WriteWorldFile, ImageType FileType, ICallback cBack)
 Saves the image to file. More...
 
string Image.Serialize (bool SerializePixels)
 Serializes the image properties to the string. More...
 

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. More...
 
string Image.CdlgFilter [get]
 Returns the common dialog filter containing all supported file extensions in string format. More...
 
int Image.FileHandle [get]
 Returns file handle for BMP image. For inner use only. More...
 
string Image.Filename [get]
 The filename associated with the object. More...
 
GeoProjection Image.GeoProjection [get, set]
 Get or sets an instance of GeoProjection class associated with the image. More...
 
ICallback Image.GlobalCallback [get, set]
 The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications. More...
 
ImageType Image.ImageType [get]
 Gets the image object's image type. More...
 
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. More...
 
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. More...
 
string Image.Key [get, set]
 The key may be used by the programmer to store any string data associated with the object. More...
 
Labels Image.Labels [get, set]
 Gets or sets instance of the labels class associated with the image. More...
 
int Image.LastErrorCode [get]
 Retrieves the last error generated in the object. More...
 
string Image.SourceFilename [get]
 Returns the filename of the datasource for an image. More...
 
tkImageSourceType Image.SourceType [get]
 The source type of the image. More...
 

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_8.png

Graph description

Function Documentation

◆ Clear()

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.

◆ Close()

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.

◆ CreateNew()

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.

◆ Deserialize()

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

◆ get_ErrorMsg()

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.

◆ Open()

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.

◆ Resource()

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.

◆ Save()

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.

◆ Serialize()

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

◆ CanUseGrouping

bool Image.CanUseGrouping
getset

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

◆ CdlgFilter

string Image.CdlgFilter
get

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

Examples
ImageLabels.cs.

◆ FileHandle

int Image.FileHandle
get

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

◆ Filename

string Image.Filename
get

The filename associated with the object.

◆ GeoProjection

GeoProjection Image.GeoProjection
getset

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

◆ GlobalCallback

ICallback Image.GlobalCallback
getset

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.

◆ ImageType

ImageType Image.ImageType
get

Gets the image object's image type.

◆ IsEmpty

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.

◆ IsInRam

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.

◆ Key

string Image.Key
getset

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

◆ Labels

Labels Image.Labels
getset

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

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

◆ LastErrorCode

int Image.LastErrorCode
get

Retrieves the last error generated in the object.

Examples
AddLayers.cs, and MarkPoints.cs.

◆ SourceFilename

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

◆ SourceType

tkImageSourceType Image.SourceType
get

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