
- 加为好友
- 发送私信
- 在线聊天
|
| 发表于:2007-11-09 22:56:212楼 得分:0 |
IPictureElement pPictureElement = new BmpPictureElementClass(); string pPicturePath = Application.StartupPath + "\\ESRI_LOGO.bmp"; pPictureElement.ImportPictureFromFile(pPicturePath); pPictureElement.SavePictureInDocument = true; pPictureElement.MaintainAspectRatio = true; #region 图形缩放 IEnvelope pEnvelope = new EnvelopeClass(); pEnvelope = this.axMapControl1.Extent; //pEnvelope.PutCoords(1, 1, 2, 2);//location on the layout for the element图片尺寸 pEnvelope.Expand(0.1, 0.1, true); //原图片缩小比例 //double dEnvAspRatio = pEnvelope.Width / pEnvelope.Height;//长宽比 //if (pPictureElement.PictureAspectRatio > dEnvAspRatio)//缩放 //{ // pEnvelope.Expand(pPictureElement.PictureAspectRatio / dEnvAspRatio, 1, true); //} //else //{ // pEnvelope.Expand(1, dEnvAspRatio / pPictureElement.PictureAspectRatio, true); //} #endregion IElement pElement; pElement = (IElement)pPictureElement; pElement.Geometry = dPoint as IGeometry; axMapControl1.ActiveView.GraphicsContainer.AddElement(pElement, 0);//Add the element to the graphics container将元素添加到MapPageLayout中 axMapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);//局部刷新Refresh the graphics | | |
修改
删除
举报
引用
回复
| |