图层设置透明度,Engine中输出图片放大后有马赛克,ArcMap中正常。

图层设置了透明度,Engine中输出图片放大后有马赛克,ArcMap中正常。
已邀请:

朱新颖

赞同来自:

【解决办法】:
在输出图片之前设置一下图像质量,参考帮助文档:http://help.arcgis.com/en/sdk/ ... 0000/

即在输出图片之前执行下面函数:
private void SetOutputQuality(IActiveView docActiveView, long iResampleRatio)
{
/* This function sets the OutputImageQuality for the active view. If the active view is a pagelayout, then
* it must also set the output image quality for each of the maps in the pagelayout.
*/
IGraphicsContainer docGraphicsContainer;
IElement docElement;
IOutputRasterSettings docOutputRasterSettings;
IMapFrame docMapFrame;
IActiveView tmpActiveView;
if (docActiveView is IMap)
{
docOutputRasterSettings = docActiveView.ScreenDisplay.DisplayTransformation
as IOutputRasterSettings;
docOutputRasterSettings.ResampleRatio = (int)iResampleRatio;
}
else if (docActiveView is IPageLayout)
{
//Assign ResampleRatio for PageLayout
docOutputRasterSettings = docActiveView.ScreenDisplay.DisplayTransformation
as IOutputRasterSettings;
docOutputRasterSettings.ResampleRatio = (int)iResampleRatio;
//and assign ResampleRatio to the maps in the PageLayout.
docGraphicsContainer = docActiveView as IGraphicsContainer;
docGraphicsContainer.Reset();
docElement = docGraphicsContainer.Next();
while (docElement != null)
{
if (docElement is IMapFrame)
{
docMapFrame = docElement as IMapFrame;
tmpActiveView = docMapFrame.Map as IActiveView;
docOutputRasterSettings =
tmpActiveView.ScreenDisplay.DisplayTransformation as
IOutputRasterSettings;
docOutputRasterSettings.ResampleRatio = (int)iResampleRatio;
}
docElement = docGraphicsContainer.Next();
}
docMapFrame = null;
docGraphicsContainer = null;
tmpActiveView = null;
}
docOutputRasterSettings = null;
}

要回复问题请先登录注册