45fan.com - 路饭网
首页
路由器设置
无线路由器
路由器密码
网络频道
手机频道
电脑频道
图库频道
问答中心
搜索:
智能搜索
搜索标题
您的位置
:
主页
>
电脑频道
>
电脑教程
> 阅读资讯:怎么样获取默认打印机纸张的设置?
怎么样获取默认打印机纸张的设置?
2016-08-29 06:41:51 来源:www.45fan.com 【
大
中
小
】
怎么样获取默认打印机纸张的设置?
CPrintDialogdlg(FALSE);
if
(
!
dlg.GetDefaults())
AfxMessageBox(_T(
"
Youhavenodefaultprinter!
"
));
else
...
{
//
attachtotheDCweweregiven
CDCdc;
dc.Attach(dlg.m_pd.hDC);
//
askforthemeasurements
int
nHorz
=
dc.GetDeviceCaps(LOGPIXELSX);
int
nVert
=
dc.GetDeviceCaps(LOGPIXELSY);
//
almostalwaysthesameinbothdirections,butsometimesnot!
/**/
/*
CStringstr;
if(nHorz==nVert)
str.Format(_T("Yourprintersupports%dpixelsperinch"),nHorz);
else
str.Format(_T("Yourprintersupports%dpixelsperinch")
_T("horizontalresolution,and%dpixelsperinchvertical")
_T("resolution"),nHorz,nVert);
*/
//
telltheuser
this
->
m_PageWidth
=
(
float
)dc.GetDeviceCaps(PHYSICALWIDTH)
/
nHorz;
this
->
m_PageHeight
=
(
float
)dc.GetDeviceCaps(PHYSICALHEIGHT)
/
nVert;
/**/
/*
AfxMessageBox(str);
str.Format(_T("实际可打印的区域width:%fheight:%f"),this->m_PageWidth,this->m_PageHeight);
AfxMessageBox(str);
*/
this
->
m_MarginLeft
=
(
float
)dc.GetDeviceCaps(PHYSICALOFFSETX)
/
nHorz;
this
->
m_MarginTop
=
(
float
)dc.GetDeviceCaps(PHYSICALOFFSETY)
/
nVert;
/**/
/*
str.Format(_T("可打印区的水平/垂直偏移width:%fheight:%f"),this->m_MarginLeft,this->m_MarginTop);
AfxMessageBox(str);
*/
this
->
m_PageActWidth
=
(
float
)dc.GetDeviceCaps(HORZRES)
/
nHorz;
this
->
m_PageActHeight
=
(
float
)dc.GetDeviceCaps(VERTRES)
/
nVert;
/**/
/*
str.Format(_T("纸张大小width:%fheight:%f"),this->m_PageActWidth,this->m_PageActHeight);
AfxMessageBox(str);
*/
this
->
m_MarginRight
=
this
->
m_PageWidth
-
this
->
m_MarginLeft
-
this
->
m_PageActWidth;
this
->
m_MarginBottom
=
this
->
m_PageHeight
-
this
->
m_MarginTop
-
this
->
m_PageActHeight;
/**/
/*
str.Format(_T("纸张右边距,下边距width:%fheight:%f"),this->m_MarginRight,this->m_MarginBottom);
AfxMessageBox(str);
*/
本文地址:
http://www.45fan.com/dnjc/69164.html
Tags:
获取
默认
打印机
编辑:路饭网
上一篇:
安装ubuntu的教程
下一篇:
推荐书目大全
相关文章列表
如何在win7系统 64位中安装打印机?
在Win10系统中将迅雷设为360浏览器默认下
如何在win7中关闭默认共享文件夹?
如何解决win7 64位系统提示"Windows7不
如何处理打印机打出来是乱码的问题?
使用Win10 edge浏览器关闭默认发送用户历
怎么样在excel2003中更改界面默认的字体
怎么样处理Win10遇到共享打印机提示错误
解决Win10自定义壁纸默认压缩的方法
怎么样设置修改Chrome默认搜索引擎?
推广内容
推荐阅读
热门推荐
推荐文章
·
如何为Excel2010表格中的图表添加说明文
·
Win7系统看电影时,如果有QQ消息,电影声
·
WPS文字文档中,如何给指定的文字添加边
·
盘点制作PPT时常用的一些快捷键大全
·
分享一组Win8系统不太为人所知的小技巧
·
系统遇到特殊故障时,如何进入Win10系统
·
电脑系统损坏要如何修复?修复win10系统
·
想找回关闭的网页该怎么办?怎样查看360
·
实现电脑每天定时关机,借助Win7任务计划
·
什么是Telnet协议?Win7如何开启Telnet服
·
电脑时间出现差错时如何进行北京时间校准
·
电脑运行速度慢,C盘空间越来越小,如何
关于我们
|
联系我们
|
友情链接
|
网站地图
|
Sitemap
|
App
|
返回顶部