ESRI.ArcGIS.ADF.IMS
Draw(Int32,Int32,Int32,Int32) Method
See Also  Example
ESRI.ArcGIS.ADF.IMS.Carto Namespace > View Class > Draw Method : Draw(Int32,Int32,Int32,Int32) Method




pixelMinX
Minimum X value for the screen (pixel) envelope at which the map will be redrawn.
pixelMinY
Minimum Y value for the screen (pixel) envelope at which the map will be redrawn.
pixelMaxX
Maximum X value for the screen (pixel) envelope at which the map will be redrawn.
pixelMaxY
Maximum Y value for the screen (pixel) envelope at which the map will be redrawn.
Redraws the map with the specified screen (pixel) envelope coordinates.

Syntax

Visual Basic (Declaration) 
Public Overloads Overridable Function Draw( _
   ByVal pixelMinX As Integer, _
   ByVal pixelMinY As Integer, _
   ByVal pixelMaxX As Integer, _
   ByVal pixelMaxY As Integer _
) As CartoImage
Visual Basic (Usage)Copy Code
Dim instance As View
Dim pixelMinX As Integer
Dim pixelMinY As Integer
Dim pixelMaxX As Integer
Dim pixelMaxY As Integer
Dim value As CartoImage
 
value = instance.Draw(pixelMinX, pixelMinY, pixelMaxX, pixelMaxY)
C# 
public virtual CartoImage Draw( 
   int pixelMinX,
   int pixelMinY,
   int pixelMaxX,
   int pixelMaxY
)

Parameters

pixelMinX
Minimum X value for the screen (pixel) envelope at which the map will be redrawn.
pixelMinY
Minimum Y value for the screen (pixel) envelope at which the map will be redrawn.
pixelMaxX
Maximum X value for the screen (pixel) envelope at which the map will be redrawn.
pixelMaxY
Maximum Y value for the screen (pixel) envelope at which the map will be redrawn.

Return Value

New redrawn map image, in the form of a CartoImage object. Use CartoImage.Url to retrieve the image's URL.

Example

The following example initializes a MapView's pixel height and width to an image control, sets an initial extent, and then Draws the map based on a pixel envelope. The map zooms to the upper left corner of its previous extent.
C#Copy Code
mapView.ImageDescriptor.Width = Convert.ToInt32(imgMap.Width.Value); 

mapView.ImageDescriptor.Height = Convert.ToInt32(imgMap.Height.Value); 

mapView.Extent = new Envelope(10, 30, 30, 50); 

  

CartoImage resultImage = mapView.Draw(0, 0, 50, 50); 

imgMap.ImageUrl = resultImage.Url; 

    
Visual BasicCopy Code
mapView.ImageDescriptor.Width = CInt(imgMap.Width.Value)

mapView.ImageDescriptor.Height = CInt(imgMap.Height.Value)

mapView.Extent = New Envelope(10, 30, 30, 50)



CartoImage resultImage = mapView.Draw(0, 0, 50, 50)

imgMap.ImageUrl = resultImage.Url

Remarks

This method allows redrawing of the map by passing in a pixel envelope relative to the current map extent and pixel dimensions. Typically this method would be used to allow a user to draw a box on the map to zoom to. This method allows zooming without having to convert the pixel dimensions to map coordinates.

Pixel coordinates originate at the upper left corner of the map. For example, the parameters (0, 0, 50, 50) will zoom the map to the upper left corner of the current map.

If the minimum pixel coordinates are negative, or the coordinates extend beyond the current map pixel size, the map will be zoomed as if the image extended to the pixel dimensions passed in.

Any Zoom, Pan, CenterAt or Draw method which changes the map extent also changes the map extent for the MapView.

See Also

© 2010 All Rights Reserved.