1. point1=map.toMapPoint(400,426);
  2. point2=map.toMapPoint(600,640);
  3. initextext = new Envelope(point1.getX(),point1.getY(),point2.getX(),point2.getY());
  4. SimpleFillSymbol sfs=new SimpleFillSymbol(Color.GRAY);
  5. sfs.setAlpha(60);
  6. agraphicLayer.addGraphic(new Graphic(initextext,sfs));
  7. map.addLayer(agraphicLayer);

先根据俩对角线的点获取Extent

05-06 15:25