|
c#,ae,布局视图导出jpg图片很不清晰怎么办?
我的代码是:
private void toolStripComboBox2_Click(object sender, EventArgs e)
{
SaveFileDialog pSaveDialog = new SaveFileDialog();
pSaveDialog.FileName = "";
pSaveDialog.Filter = "JGP图片(*.jpg)|*.jpg|tif图片(*.tif)|*.tif|PDF文档(*.pdf)|*.pdf";
if (pSaveDialog.ShowDialog() == DialogResult.OK)
{
// 获取布局视图屏幕分辨率,用于设置输出分辨率
double iScreenDispalyResolution = axPageLayoutControl1.ActiveView.ScreenDisplay.DisplayTransformation.Resolution;
// 根据用户选择保存的文件类型,来创建不同的输出类
IExporter pExport=null ;
if (pSaveDialog.FilterIndex == 1)
{
pExport = new JpegExporter() as IExporter;
}
else if (pSaveDialog.FilterIndex == 2)
{
pExport = new TiffExporter() as IExporter;
}
else if (pSaveDialog.FilterIndex == 3)
{
pExport = new PDFExporter() as IExporter;
}
// 设置输出文件名,为用户在保存窗口设置的文件名
pExport.ExportFileName = pSaveDialog.FileName;
// 设置输出分辨率
pExport.Resolution = (short)iScreenDispalyResolution;
// 获取输出范围?? 获取视图框架对象,进而得到视图范围
IActiveView pActiveView = axPageLayoutControl1.PageLayout as IActiveView;
IActiveView view = pActiveView.FocusMap as IActiveView;
tagRECT deviceRect = view.ExportFrame;//.ScreenDisplay.DisplayTransformation.get_DeviceFrame();
IEnvelope pDeviceEnvelop = new EnvelopeClass();
// 设置一个边框范围
pDeviceEnvelop.PutCoords(deviceRect.left, deviceRect.bottom, deviceRect.right, deviceRect.top);
// 将打印像素范围 设置给输出对象
pExport.PixelBounds = pDeviceEnvelop;
// 设置跟踪取消对象
ITrackCancel pCancle = new CancelTracker();
// 进行视图控件的视图输出操作,设置对应参数
axPageLayoutControl1.ActiveView.Output(pExport.StartExporting(), pExport.Resolution, ref deviceRect, null,null);
Application.DoEvents();// 启动应用程序
pExport.FinishExporting();//完成输出
}
}
我将分辨率设置为600也还是不清晰,请问怎么解决?
|
|