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.
Graph description
◆ 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
-
CanvasColor | The color to be used to as the new color of every pixel in the image. This is a UInt32 representation of an RGB value. |
cBack | Optional. 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()
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
-
NewWidth | The width of the new image in pixels. |
NewHeight | The 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
-
- 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
-
ErrorCode | The error code for which the error message is required. |
- Returns
- The error message description for the specified error code.
◆ Open()
Opens an image from file.
- Parameters
-
ImageFileName | The filename of the image to be opened. |
fileType | Optional. The type of image being opened. The default is "USE_FILE_EXTENSION". |
InRam | Optional. 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. |
cBack | Optional. 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
-
NewImgPath | The 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
-
ImageFileName | The filename to use to save the image. |
WriteWorldFile | Optional. A boolean value representing whether a world file is also written. The default is false. |
FileType | Optional. The file type to use to save the image. Default is "USE_FILE_EXTENSION". |
cBack | Optional. 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
-
SerializePixels | A boolean value which indicates whether image pixels should be serialized. |
- Returns
- The serialized string.
- New API 4.8:
- Added in version 4.8
◆ 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
Returns the common dialog filter containing all supported file extensions in string format.
- Examples
- ImageLabels.cs.
◆ FileHandle
Returns file handle for BMP image. For inner use only.
◆ Filename
The filename associated with the object.
◆ GeoProjection
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
◆ ImageType
Gets the image object's image type.
◆ IsEmpty
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
Returns true when the image is loaded in RAM memory, and returns false when the image is not loaded in RAM memory.
◆ Key
The key may be used by the programmer to store any string data associated with the object.
◆ Labels
◆ LastErrorCode
◆ 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
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