This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IG > IGeometry3 Interface > IGeometry3.QueryWKSEnvelope Method (ArcObjects .NET 10.5 SDK) |
Defines the specified wksenvelope to be the current extent of this geometry in the x-y plane.
[Visual Basic .NET] Public Sub QueryWKSEnvelope ( _ ByRef e As WKSEnvelope _ )
[C#] public void QueryWKSEnvelope ( ref WKSEnvelope e );
[C++]
HRESULT QueryWKSEnvelope(
_WKSEnvelope* e
);
[C++]
Parameters e [out]
e is a parameter of type _WKSEnvelope
The QueryWKSEnvelope method returns a WKSEnvelope structure corresponding to the envelope of the geometry. Use that method to quickly get the XMin, XMax, YMin and YMax values.
//This example demonstrates how to use the QueryWKSEnvelope method
private void QueryWKSEnvelope_Example()
{
IGeometry3 geometry=CreateRectanglePolygon() as IGeometry3;
WKSEnvelope wksEnvelope=new WKSEnvelope();
geometry.QueryWKSEnvelope(out wksEnvelope);
System.Windows.Forms.MessageBox.Show("Xmin, Xmax, Ymin, Ymax: " + wksEnvelope.XMin + " , " + wksEnvelope.XMax + " , " + wksEnvelope.YMin + " , " + wksEnvelope.YMax);
}
private IPolygon CreateRectanglePolygon()
{
IEnvelope envelope=new EnvelopeClass();
envelope.PutCoords(0, 0, 20, 20);
ISegmentCollection segmentCollection=new PolygonClass();
segmentCollection.SetRectangle(envelope);
return segmentCollection as IPolygon;
}