The Device Context

本文介绍了设备上下文的概念及其在Windows绘图系统中的作用。设备上下文是一种Windows对象,用于封装绘制线条、形状和文本等操作的属性。通过设备上下文,开发者可以实现与设备无关的绘制,并能轻松地在不同输出设备间切换。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 “设备上下文”是The Device Context的翻译。
设备上下文是一种包含有关某个设备(如显示器或打印机)的绘制属性信息的 Windows 数据结构。所有绘制调用都通过设备上下文对象进行,这些对象封装了用于绘制线条、形状和文本的 Windows API。设备上下文允许在 Windows 中进行与设备无关的绘制。设备上下文可用于绘制到屏幕、打印机或者图元文件。

关于设备上下文,叫法颇多,有些书上说为设备环境、显示场景,更常见的叫做设备描述表或设备描述体。当然你爱怎么叫随你的便,我还是喜欢说为设备场景。
那么究竟什么是设备场景呢? 设备场景是一种windows对象,而windows则是一种图形环境,其图形系统令人难以自信地灵活和强大。而实质上,widnows下的所有绘图都是通过设备场景进行的,而不是直接对窗口和设备本身进行。为了说明设备场景,很多书都拿一些现实生活中的现象来进行对照说明。其中,最常见的是把它比喻为一位画家在作画。我想大家都看过画家是如何画画的,最起码是在电影里或者是在道旁的广告牌上作画的画家。我们可以想象一下∶有个风景秀丽的白云山(是我瞎起的名)上,有位画家一只手拿着调色板,另一只手则拿着画笔,面对一个画板正在写风景画。有些书认为画家的调色板相当于设备场景,有些书则认为画板相当于设备场景,说法不一。

 

 

 

设备上下文是一个结构,是一个表现一组图形对象和属性的结构,还有一些输出设备的设置和属性。使用设备上下文允许你直接操纵图形,不用考虑低级细节。Windows   GDI是一个图形翻译系统,是介于应用程序和图形硬件之间的一层。GDI可以输出到任意的兼容设备,不过最常使用的设备是视频监视器、图形硬拷贝设备(如打印机或绘图仪),或者是内存中的图元文本。GDI函数能够绘制直线、曲线、封闭的图形和文本。所有访问GDI的Windows函数都需要一个设备上下文句柄作为参数。

General Information You can add external commands to each device on the map. E.g., execute the ping.exe utility or remote desktop, etc. In addition, the device parameters (like device address) will be entered automatically. This feature turns the Algorius Net Viewer into an effective tool for managing a computer network. Algorius Net Viewer contains large list of predefined external commands. Application makes a check at the first launch and enables only those commands which are available on a machine. You can hide, remove commands, or add a new command. Please, contact us if you need any additional external commands to be predefined. We are interested in it, and will try to add them in the next software version (for free). Configuring To configure external commands, select Commands→Configure from the device context menu. The Options window will appear: This window will allow you to add, edit, delete and group the external commands. You can also use available external commands as a basis for new one’s (external command duplicate option). There are built-in external commands which can’t be deleted or edited. They are located in Standard group by default. Checkbox next to external command of group of commands enables or disables its display in device context menu. You can drag an external command or group of commands with a mouse to another group. You can remove a command from a group in the same way. Pressing the Up (Ctrl+Up) or the Down →Ctrl+Down) buttons allows you to reorder external commands. Clicking the Add, Duplicate or Edit button will display the External Command window:
最新发布
03-20
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值