public static final ImagePoint convertPoint(MapPoint mapPoint,MapEnvelope mapEnv,int imgHeight,int imgWidth){
  long imageY=Math.round(convertY(mapPoint,mapEnv,imgHeight));
  long imageX=Math.round(convertX(mapPoint,mapEnv,imgWidth));
  return new ImagePoint(imageX,imageY);
}

public static final ImagePoint convertPoint ( MapPoint mapPoint , MapEnvelope mapEnv , int imgHeight , int imgWidth ) { long imageY = Math . round ( convertY ( mapPoint , mapEnv , imgHeight ) ) ; long imageX = Math . round ( convertX ( mapPoint , mapEnv , imgWidth ) ) ; return new ImagePoint ( imageX , imageY ) ; }
this method assumes that parameter p is a doittpoint in map coordinates and converts it under the assumption that the mapenv parameter field is properly set in map coordinates and that the imgheight and imgwidth are the dimensions of the map image in pixels .
