本文整理汇总了C#中Envelope.QueryCoords方法的典型用法代码示例。如果您正苦于以下问题:C# Envelope.QueryCoords方法的具体用法?C# Envelope.QueryCoords怎么用?C# Envelope.QueryCoords使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Envelope
的用法示例。
在下文中一共展示了Envelope.QueryCoords方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: document_PrintPage
private void document_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
string sPageToPrinterMapping = "esriPageMappingScale";
if (sPageToPrinterMapping == null)
//默认是Tile
axPageLayoutControl1.Page.PageToPrinterMapping = esriPageToPrinterMapping.esriPageMappingTile;
else if (sPageToPrinterMapping.Equals("esriPageMappingTile"))
axPageLayoutControl1.Page.PageToPrinterMapping = esriPageToPrinterMapping.esriPageMappingTile;
else if (sPageToPrinterMapping.Equals("esriPageMappingCrop"))
axPageLayoutControl1.Page.PageToPrinterMapping = esriPageToPrinterMapping.esriPageMappingCrop;
else if (sPageToPrinterMapping.Equals("esriPageMappingScale"))
axPageLayoutControl1.Page.PageToPrinterMapping = esriPageToPrinterMapping.esriPageMappingScale;
else
axPageLayoutControl1.Page.PageToPrinterMapping = esriPageToPrinterMapping.esriPageMappingTile;
//获取图形设备分辨率
short dpi = (short)e.Graphics.DpiX;
//设备边框
IEnvelope devBounds = new Envelope() as IEnvelope;
//获得页面
IPage page = axPageLayoutControl1.Page;
//打印页数
short printPageCount;
printPageCount = axPageLayoutControl1.get_PrinterPageCount(0);
m_CurrentPrintPage++;
//当前打印机
IPrinter printer = axPageLayoutControl1.Printer;
//打印机设备边框
page.GetDeviceBounds(printer, m_CurrentPrintPage, 0, dpi, devBounds);
//设备边框矩形
tagRECT deviceRect;
//设备边框矩形坐标
double xmin, ymin, xmax, ymax;
devBounds.QueryCoords(out xmin, out ymin, out xmax, out ymax);
//初始化边框矩形
deviceRect.bottom = (int)ymax;
deviceRect.left = (int)xmin;
deviceRect.top = (int)ymin;
deviceRect.right = (int)xmax;
//边框是否可见
IEnvelope visBounds = new Envelope() as IEnvelope;
page.GetPageBounds(printer, m_CurrentPrintPage, 0, visBounds);
//获得图形设备句柄以便打印预览
IntPtr hdc = e.Graphics.GetHdc();
//根据指定边框打印
axPageLayoutControl1.ActiveView.Output(hdc.ToInt32(), dpi, ref deviceRect, visBounds, m_TrackCancel);
//检测是否还有打印任务
if (m_CurrentPrintPage < printPageCount)
e.HasMorePages = true;
else
e.HasMorePages = false;
//释放设备
e.Graphics.ReleaseHdc(hdc);
}