Public Member Functions | Properties
Image Class Reference

Represents an raster image of particular format which may be added to the map. More...

List of all members.

Public Member Functions

bool _pushSchemetkRaster (GridColorScheme cScheme)
 Sets color scheme to use in process of generation of the image representation of the grid.
void BufferToProjection (int BufferX, int BufferY, out double projX, out double projY)
 Converts the position of pixel in image buffer to the map coordinates.
bool BuildOverviews (tkGDALResamplingMethod ResamplingMethod, int NumOverviews, Array OverviewList)
 Builds overviews for GDAL image.
bool Clear (uint CanvasColor, ICallback cBack)
 Clears the image using the specified canvas color as the new color for every pixel in the image.
bool ClearOverviews ()
 Clears the overviews for the datasource.
bool Close ()
 Closes the image.
bool CreateNew (int NewWidth, int NewHeight)
 Creates a new image with specified width and height.
void Deserialize (string newVal)
 Restores the properties of the image object from the serialized string.
GdalRasterBand get_Band (int bandIndex)
 Gets the band with the specified index.
double get_BandMaximum (int bandIndex)
 Gets the maximum value for the specified band.
double get_BandMinimum (int bandIndex)
 Gets the minimum value for the specified band.
string get_ErrorMsg (int ErrorCode)
 Retrieves the error message associated with the specified error code.
int get_Value (int Row, int col)
 Gets the value of a pixel in the image.
uint get_ValueWithAlpha (int Row, int col)
 Gets the value of the specified pixel including the alpha component.
bool GetImageBitsDC (int hdc)
 Gets the data from the image and puts it into the selected bitmap in the specified device context.
string GetProjection ()
 Retrieves projection string from the associated .prj file.
bool GetRow (int Row, ref int Vals)
 Gets a row of pixels from the image.
int GetUniqueColors (double MaxBufferSizeMB, out object Colors, out object Frequencies)
 Returns the arrays with the unique colors of the image and their frequencies.
void ImageToProjection (int ImageX, int ImageY, out double projX, out double projY)
 Converts coordinates of image's pixel to the screen coordinates.
bool LoadBuffer (double maxBufferSize)
 Loads the whole image in the memory buffer of specified size. Applicable for GDAL images only.
bool Open (string ImageFileName, ImageType fileType, bool InRam, ICallback cBack)
 Opens an image from file.
Grid OpenAsGrid ()
 Opens the datasource of the image as grid.
void ProjectionToBuffer (double projX, double projY, out int BufferX, out int BufferY)
 Returns the coordinates of pixel in image buffer which correspond to the given point on the map.
void ProjectionToImage (double projX, double projY, out int ImageX, out int ImageY)
 Returns the coordinates of image pixel which correspond to the given point on the map.
bool Resource (string newImgPath)
 Changes the data source of the image object without the its closing.
bool Save (string ImageFileName, bool WriteWorldFile, ImageType fileType, ICallback cBack)
 Saves the image to file.
string Serialize (bool SerializePixels)
 Serializes the image properties to the string.
void set_Value (int Row, int col, int pVal)
 Sets the value of a pixel in the image.
void set_ValueWithAlpha (int Row, int col, uint pVal)
 Sets the value of the specified pixel including the alpha component.
bool SetBandMinMax (int bandIndex, double min, double max)
 Sets the band minimum maximum values for the band. Values outside of this range will not be rendered.
bool SetDefaultMinMax (int bandIndex)
 Calculates the minimum and maximum values for the specified band and caches them for further use.
bool SetImageBitsDC (int hdc)
 This function uses a bitmap selected in the specified device context handle as the data to copy into the image for which the function is called.
void SetNoDataValue (double Value, ref bool Result)
 Sets no-data value for the image. Applicable for GDAL images only.
bool SetProjection (string Proj4)
 Sets projection string for the image.
void SetTransparentColor (uint Color)
 Sets transparent color for image.
void SetVisibleExtents (double newMinX, double newMinY, double newMaxX, double newMaxY, int newPixelsInView, float transPercent)
 Reloads the image buffer to represent the specified map extents. Applicable for GDAL images only.

Properties

GdalRasterBand ActiveBand [get, set]
 Gets the active band (the one used for rendering when grid rendering is on).
GridColorScheme ActiveColorScheme [get, set]
 Gets the active color scheme used for the rendering, it may be either default or custom one.
tkGridRendering AllowGridRendering [get, set]
 Gets or sets the value which indicates whether the image will be rendered as grid, i.e. with a color scheme applied to a band set by Image.SourceGridBandIndex.
bool AllowHillshade [get, set]
 Indicate whether hillshade algorithm will be used for generation of image representation of the grid.
int AlphaBandIndex [get, set]
 Gets or sets the index of the alpha band.
int BlueBandIndex [get, set]
 Gets or sets the index of the blue band (used when RGB rendering is chosen).
float Brightness [get, set]
 Gets or sets the brightness of the image.
int BufferOffsetX [get, set]
 Gets the index of the left most pixel of the original image that was included in the current buffer.
int BufferOffsetY [get, set]
 Gets the index of the top most pixel of the original image that was included in the current buffer.
int BufferSize [get, set]
 Gets or sets the size of image buffer in percentage.
bool 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 CdlgFilter [get]
 Returns the common dialog filter containing all supported file extensions in string format.
bool ClearGDALCache [get, set]
 Clears the cache of GDAL library which can be used for faster display.
uint ColorizeColor [get, set]
 Gets or sets the color of the colorize.
float ColorizeIntensity [get, set]
 Gets or sets the colorize intensity.
float Contrast [get, set]
 Gets or sets the contrast of the image.
GridColorScheme CustomColorScheme [get, set]
 Gets or sets the color scheme to render image with.
tkInterpolationMode DownsamplingMode [get, set]
 The interpolation mode for images which are displayed with the resolution higher than original, i.e. after zoom in (down).
int DrawingMethod [get, set]
 Gets or sets the drawing method of image.
double dX [get, set]
 Gets or sets the number of map units per pixel of image buffer for x axis.
double dY [get, set]
 Gets or sets the number of map units per pixel of image buffer for y axis.
Extents Extents [get]
 Returns the extents of the image.
int FileHandle [get]
 Returns file handle for BMP image. For inner use only.
string Filename [get]
 The filename associated with the object.
bool ForceSingleBandRendering [get, set]
 Gets or sets a value indicating whether the band set by Image.ActiveBandIndex will be used rather then RGB rendering.
float Gamma [get, set]
 Gets or sets the gamma correction value for the image.
GdalDriver GdalDriver [get, set]
 Gets the GDAL driver which manages the current datasource.
GeoProjection GeoProjection [get]
 Get or sets an instance of GeoProjection class associated with the image.
ICallback GlobalCallback [get, set]
 The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
int GreenBandIndex [get, set]
 Gets or sets the index of the green band (used when RGB rendering is chosen).
GridColorScheme GridProxyColorScheme [get]
 Gets grid color scheme this proxy image was generated with. The method should be called for proxy images only: Image.IsGridProxy = true.
bool GridRendering [get]
 Returns true if the image is rendered as grid.
bool HasColorTable [get]
 Returns a boolean value which indicates whether an image has a color table. Applicable for GDAL images only.
int Height [get]
 Gets the height of the image in pixels.
float Hue [get, set]
 Gets or sets the hue of the image.
bool IgnoreColorTable [get, set]
 Gets or sets a value indicating whether built-in color table of the image will be ignored.
PredefinedColorScheme ImageColorScheme [get, set]
 Gets or sets the predefined color scheme for the image. Applicable for GDAL images only.
ImageType ImageType [get]
 Gets the image object's image type.
bool 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 IsGridProxy [get]
 Gets the value which indicates whether an image object represents a visualization proxy for another datasource.
bool IsInRam [get]
 Returns true when the image is loaded in RAM memory, and returns false when the image is not loaded in RAM memory.
bool IsRgb [get]
 Returns true if the datasource represents RGB image.
string Key [get, set]
 The key may be used by the programmer to store any string data associated with the object.
Labels Labels [get, set]
 Gets or sets instance of the labels class associated with the image.
int LastErrorCode [get]
 Retrieves the last error generated in the object.
int NoBands [get]
 Returns the number of bands of GDAL image.
int NumOverviews [get]
 Returns the number of overviews for GDAL image.
double OriginalDX [get, set]
 Gets or sets the number of map units per image pixel for x axis.
double OriginalDY [get, set]
 Gets or sets the number of map units per image pixel for y axis.
int OriginalHeight [get]
 Gets the height of the image.
int OriginalWidth [get]
 Gets the width of the image.
double OriginalXllCenter [get, set]
 Gets or sets the x coordinate of the center of lower left pixel of the image in map units.
double OriginalYllCenter [get, set]
 Gets or sets the y coordinate of the center of lower left pixel of the image in map units.
string PaletteInterpretation [get]
 Gets the type of palette interpretation. Applicable for GDAL images only.
tkPaletteInterpretation PaletteInterpretation2 [get, set]
 Gets the palette interpretation for the image.
stdole.IPictureDisp Picture [get, set]
 Gets or sets the picture object.
int RedBandIndex [get, set]
 Gets or sets the index of the red band (used when RGB rendering is chosen).
tkRasterRendering RenderingMode [get, set]
 Gets the current rendering mode for the image (depends on the values of other properties).
bool ReverseGreyscale [get, set]
 Gets or sets a value indicating whether colors should be reversed during gray scale rendering (i.e. the smallest values are white).
float Saturation [get, set]
 Gets or sets the saturation of the image.
bool SetToGrey [get, set]
 A boolean value which indicates whether an image will be displayed using a gray palette.
string SourceFilename [get]
 Returns the filename of the datasource for an image.
int SourceGridBandIndex [get, set]
 Gets or sets index of band within datasource whose values should be used to apply color scheme.
string SourceGridName [get]
 Gets the name of the source grid in case the image represent a visualization proxy for a grid.
tkImageSourceType SourceType [get]
 The source type of the image.
uint TransparencyColor [get, set]
 Gets or sets a color which is used as the transparency color for the image.
uint TransparencyColor2 [get, set]
 Gets or sets a second color which is used as the transparency color for the image.
double TransparencyPercent [get, set]
 Gets or sets the value which define alpha component of image colors (0.0-1.0).
tkInterpolationMode UpsamplingMode [get, set]
 The interpolation mode for images which are displayed with the resolution lower than original, i.e. after zooming out (up).
bool UseActiveBandAsAlpha [get, set]
 Gets or sets a value indicating whether to use active band as an alpha band as well.
bool UseHistogram [get, set]
 Gets or sets a boolean value which indicates whether a histogram will be used. Applicable for GDAL images only.
bool UseRgbBandMapping [get, set]
 Gets or sets a value indicating whether RGB band mapping will be used.
bool UseTransparencyColor [get, set]
 Gets or sets whether or not the transparency color is being used when the image is displayed.
bool Warped [get]
 Returns true if the image is warped, i.e. there are rotation parameters in world file.
int Width [get]
 Gets the width of the image in pixels.
double XllCenter [get, set]
 Gets or sets the x coordinate of the center of the lower-left pixel in the image.
double YllCenter [get, set]
 Gets or sets the y coordinate of the center of the lower-left pixel in the image.

Detailed Description

Represents an raster image of particular format which may be added to the map.

dot_inline_dotgraph_44.png

Graph description

Here is a diagram with groups of API members for Image class.

dot_imagegroups.png
Graph description

Types of image handling.

The class is a wrapper for several representation of images used internally:

1. In-RAM images created with Image.CreateNew method and not bound to any file;

2. Disk-based images handled by MapWinGIS own driver;

3. GDAL-based images:

Inner representation of image can be determined via Image.SourceType property. Some properties and methods are applicable to the GDAL images only.

Examples:
AddLayers.cs, ImageLabels.cs, MarkPoints.cs, PointIcons.cs, SortLayers.cs, and TrackCars.cs.
 All Classes Files Functions Enumerations Properties Events