您的位置:首页 > 其它

导出图片,包含栅格的地图导出的图片模糊,arcgis eingine

2015-07-23 11:48 323 查看
原因:栅格数据重采样了,解决方法:

PixelBoundsEnv = new Envelope() as IEnvelope;

if (bClipToGraphicsExtent && (docActiveView is IPageLayout))

{

docGraphicsExtentEnv = GetGraphicsExtent(docActiveView);

docPageLayout = docActiveView as PageLayout;

pUnitConvertor = new UnitConverter();

//assign the x and y values representing the clipped area to the PixelBounds envelope

PixelBoundsEnv.XMin = 0;

PixelBoundsEnv.YMin = 0;

PixelBoundsEnv.XMax = pUnitConvertor.ConvertUnits(docGraphicsExtentEnv.XMax, docPageLayout.Page.Units, esriUnits.esriInches) * docExport.Resolution - pUnitConvertor.ConvertUnits(docGraphicsExtentEnv.XMin,
docPageLayout.Page.Units, esriUnits.esriInches) * docExport.Resolution;

PixelBoundsEnv.YMax = pUnitConvertor.ConvertUnits(docGraphicsExtentEnv.YMax, docPageLayout.Page.Units, esriUnits.esriInches) * docExport.Resolution - pUnitConvertor.ConvertUnits(docGraphicsExtentEnv.YMin,
docPageLayout.Page.Units, esriUnits.esriInches) * docExport.Resolution;

//'assign the x and y values representing the clipped export extent to the exportRECT

exportRECT.bottom = (int)(PixelBoundsEnv.YMax) + 1;

exportRECT.left = (int)(PixelBoundsEnv.XMin);

exportRECT.top = (int)(PixelBoundsEnv.YMin);

exportRECT.right = (int)(PixelBoundsEnv.XMax) + 1;

//since we're clipping to graphics extent, set the visible bounds.

docMapExtEnv = docGraphicsExtentEnv;

}

else

{

double tempratio = iOutputResolution / iScreenResolution;

double tempbottom = DisplayBounds.bottom * tempratio;

double tempright = DisplayBounds.right * tempratio;

//'The values in the exportRECT tagRECT correspond to the width

//and height to export, measured in pixels with an origin in the top left corner.

exportRECT.bottom = (int)Math.Truncate(tempbottom);

exportRECT.left = 0;

exportRECT.top = 0;

exportRECT.right = (int)Math.Truncate(tempright);

//populate the PixelBounds envelope with the values from exportRECT.

// We need to do this because the exporter object requires an envelope object

// instead of a tagRECT structure.

PixelBoundsEnv.PutCoords(exportRECT.left, exportRECT.top, exportRECT.right, exportRECT.bottom);

//since it's a page layout or an unclipped page layout we don't need docMapExtEnv.

docMapExtEnv = null;

}

// Assign the envelope object to the exporter object's PixelBounds property. The exporter object

// will use these dimensions when allocating memory for the export file.

docExport.PixelBounds = PixelBoundsEnv;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: