Identifies pixel values on a point of this image layer.
Syntax
Parameters
- point
- Point at which to get pixel values for.
Return Value
MultibandCollection containing the pixel values.
Example
The following example performs an identify on an image layer at a point, and
displays the results. In this case, the image layer is a single image rather than a
raster catalog, so only a single Multiband object will be returned within the
MultibandCollection. The image is a JPG image, so we get back three bands, one for
each RGB color. This example assumes an existing MapView object.
C# | Copy Code |
---|
// Find the layer to identify on ImageLayer imgLayer = (ImageLayer)mapView.Layers.FindByName("World Image"); // Do identify Point idPt = new Point(-99.0, 44.0); MultibandCollection idResultCollection = imgLayer.Identify(idPt); // Since this is a single image, only one item is in the collection // (raster catalogs could have multiple image pixels at a location) Multiband idResult = idResultCollection[0]; // Display the value in the pixel. In this case, it's the RGB value of the pixel. Label1.Text = String.Format("Pixel color values in {0} at x={1}, y={2} are: R={3}, G={4}, B={5}", idResult.RasterID, idPt.X, idPt.Y, idResult[0], idResult[1], idResult[2]); |
Visual Basic | Copy Code |
---|
Dim imgLayer As ImageLayer = _
CType(mapView.Layers.FindByName("World Image"), ImageLayer)
Dim idPt As New Point(-99.0, 44.0)
Dim idResultCollection As MultibandCollection = imgLayer.Identify(idPt)
Dim idResult As Multiband = idResultCollection(0)
Label1.Text = _
String.Format("Pixel color values in {0} at x={1}, y={2} are: R={3}, G={4}, B={5}", _
idResult.RasterID, idPt.X, idPt.Y, idResult(0), idResult(1), idResult(2))
|
Remarks
See Also