双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

C#调用GetDeviceCaps参数nIndex是多少?

bdbox@qq.com bdbox@qq.com 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
C#调用GetDeviceCaps参数nIndex是多少?

hdc
[in] Handle to the DC.

nIndex
[in] Specifies the item to return. This parameter can be one of the following values. Index Meaning
DRIVERVERSION The device driver version.
TECHNOLOGY Device technology. It can be any one of the following values.
DT_PLOTTER Vector plotter
DT_RASDISPLAY Raster display
DT_RASPRINTER Raster printer
DT_RASCAMERA Raster camera
DT_CHARSTREAM Character stream
DT_METAFILE Metafile
DT_DISPFILE Display file
If the hdc parameter is a handle to the DC of an enhanced metafile, the device technology is that of the referenced device as specified to the CreateEnhMetaFile function. To determine whether it is an enhanced metafile DC, use the GetObjectType function.
HORZSIZE Width, in millimeters, of the physical screen.
VERTSIZE Height, in millimeters, of the physical screen.
HORZRES Width, in pixels, of the screen; or for printers, the width, in pixels, of the printable area of the page.
VERTRES Height, in raster lines, of the screen; or for printers, the height, in pixels, of the printable area of the page.
....

在使用C#调用时 ,应传入整型,但不知道各个值对应的整型应是多少?是按帮助中顺序来吗?

谢谢


...全文
C# 下的自由打印,不使用水晶报表,实现列表式的打印。 不使用水晶报表,实现列表式的打印。 刚学C# 1个月时写的,如果污染了视听,请见谅。 struct PageProperty { public int PageLeft; public int PageTop; public int PageBottom; public int PageWidth; public int PageHeight; public int RowSpace; public int ColSpace; public int AllVisibleColSpace; public int AllColWidth; public int AllVisibleColWidth; public int AllRowHeight; public int TitleH; public int SubTitleH; public int FooterH; public int[] ColWidth; public int VisibleColWidth; public int PageTextHeight; public int PageTextWidth; } struct TRect { public int Left; public int Top; public int Right; public int Bottom; } class PanelImage : Panel { protected Panel panelShadow = null; public PictureBox ImgData = null; public PanelImage() { this.BackColor = Color.Gray; this.DoubleBuffered = true; ImgData = new PictureBox(); ImgData.Parent = this; ImgData.BackColor = Color.White; panelShadow = new Panel(); panelShadow.Parent = this; panelShadow.BackColor = Color.Black; ResizeControl(); } void ResizeControl() { panelShadow.Left = 8; panelShadow.Top = 8; panelShadow.Width = this.Width - 12; panelShadow.Height = this.Height - 12; ImgData.Left = 4; ImgData.Top = 4; ImgData.Width = this.Width - 12; ImgData.Height = this.Height - 12; } protected override void OnResize(EventArgs eventargs) { ResizeControl(); base.OnResize(eventargs); } protected override void Dispose(bool disposing) { panelShadow.Dispose(); ImgData.Dispose(); base.Dispose(disposing); } } public partial class PrintGrid { [DllImport("gdi32.dll", EntryPoint = "GetDeviceCaps", CallingConvention = CallingConvention.StdCall)] public static extern int GetDeviceCaps(int Handle, int nIndex); private float _leftMargin = 0; private float _topMargin = 0; private float _rightMargin = 0; private float _bottomMargin = 0; const short HORZSIZE = 4; const short VERTSIZE = 6; const short HORZRES = 8; const short VERTRES = 10; const short PHYSICALOFFSETX = 112; const short PHYSICALOFFSETY = 113; int ixLogPixPerInch; int iyLogPixPerInch; int xLogPixPerInch; int yLogPixPerInch; int FPageIndex; int FPageCount; string FLeftPageFooter; string FRightPageFooter; string FTitle; Font FFont; Font FTitleFont; Font FTextFont; Font FFooterFont; Font FSubTitleFont; int FSubTitleOff; int FLeftPageFooterOff; int FPrintCount; string FSubTitle; bool FHLine; bool FVLine; int FPageTop; int FPageLeft; int FPageRight; int FPageBottom; int FToPage; int FFromPage; bool FPrintPageCount; string FRightSubTitle; bool FExistPrinter; bool FCenterShow; Color FHeaderColor; bool FUseHeaderColor; private int iDX; //水平缩放比例 private int iDY; //垂直缩放比例 private int ColCount; //总列数 private int RowCount; //总行数 private int[] ColWidth; //记录每一列的宽度 private int AllColWidth; //所有列的宽度 private int AllVisibleColWidth; //所有可视列的宽度 private int RowSpace; //行间距 private int ColSpace; //所有可视列间距 private int AllVisibleColSpace; //所有行的间距 private int AllColSpace; //所有列的间距 private int AllRowSpace; //所有行的间距 private int RowsOfPage; //每页打的行数 private int PageWidth; //页的宽度 private int PageHeight; //页的高度 private int PageTextHeight; //页正文高度 private int PageTextWidth; //页正文宽度 private int TextTop; //正文上边距 private int TextLeft; //正文左边距 private int TitleH; //标题高度 private int SubTitleH; //子标题高度 private int FooterH; //页脚高度 private int FooterTop; //页脚顶部 private int TextH; //正文高度 private int VisibleColWidth; private int DX; private int DY; private string StrTest; private ListView ListViewData = null; //数据 private PrintDocument PD = null; 立即下载

相关推荐

SnatchDisplayDeviceListMode_C#_

C#小程序获取到当前显示器的分辨率和颜色值大小

weixin_42668301

如何获得系统的颜色深度(位数) (3KB)...

如何获得系统的颜色深度(位数) (3KB)

求伯乐

无刷直流电机模糊神经网络PID-模糊PID-传统PID三种控制对比Simulink仿真

内容概要:本文系统研究了无刷直流电机(BLDCM)在Simulink环境下的三种控制策略:传统PID控制、模糊PID控制以及模糊神经网络PID控制。研究基于三相桥式星型全控电路结构,构建了转速电流双闭环控制系统,并通过Matlab/Simulink搭建仿真模型,全面对比分析了三种算法在动态响应速度、稳态精度、抗干扰能力及系统鲁棒性等方面的性能差异。文章深入阐述了各控制方法的设计原理与实现机制,重点突出了模糊逻辑与神经网络在自适应调节PID参数方面的优势,验证了智能控制算法在提升电机控制品质上的显著效果。同时,文档提供了详实的仿真资源、参考文献和技术说明,有助于读者复现实验并深化对先进控制策略的理解与应用。 适合人群:具备自动控制理论基础和MATLAB/Simulink仿真能力的电气工程、自动化及相关专业的研究生、科研人员及工程技术人员,特别适用于从事电机驱动系统设计、智能控制算法开发等领域的专业人士。 使用场景及目标:①用于教学与科研中对比分析传统PID、模糊PID与模糊神经网络PID在无刷直流电机调速系统中的控制性能差异;②为高性能电机控制器的设计与优化提供仿真验证平台,支持参数整定与控制策略选型;③辅助完成毕业设计、科研项目或工业应用中的控制算法评估与改进。 阅读建议:建议读者结合所提供的Simulink模型与参考文献,逐步复现仿真过程,重点关注不同控制器的参数整定方法、响应曲线特征及其在负载扰动下的表现。可进一步拓展研究方向,如引入无位置传感器控制、滑模观测器或模型预测控制等先进控制技术,以深化对现代电机智能控制体系的理解与创新能力。

欢多天天写代码

分省份-城投债信用利差跟踪(私募债)20260206.xlsx

分省份-城投债信用利差跟踪(私募债)20260206.xlsx

温柔-的-女汉子

高校技术转移办公室人员如何高效管理技术成果全生命周期?.docx

科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。

BIZKEEN
评论 2
收藏 已收藏
分享
返回顶部
bdbox@qq.com
C# 111,129 成员 642,540 内容