简体   繁体   English

使用C ++直接写到屏幕

[英]Write directly to screen with c++

Hello I am new to c++ and am wondering where to go about looking to print directly to the screen? 您好,我是C ++的新手,想知道直接在屏幕上打印该去哪里? For example the HUD interface that appears on laptops when you change the volume. 例如,更改音量时笔记本电脑上显示的HUD界面。 I'm not really looking for any fancy graphics, just, say, a variable or info from a file. 我并不是真正在寻找任何精美的图形,只是从文件中查找变量或信息。

I've tried googling but havn't come up with anything yet. 我曾尝试使用Google搜索,但是还没有提出任何建议。 So...where should I begin looking? 所以...我应该从哪里开始寻找?

Thanks! 谢谢!

Under windows there are a few ways to do it. 在Windows下,有几种方法可以执行此操作。 You could use DirectDraw Overlays (If the system supports them). 您可以使用DirectDraw叠加层(如果系统支持)。 Or you could create a layered window (WS_EX_LAYERED) and make everything but the bit you want to display transparent. 或者,您可以创建一个分层窗口 (WS_EX_LAYERED),并使除要显示的位以外的所有内容都透明。

Pure C++ has only one screen interface, in the library. 在库中,Pure C ++仅具有一个屏幕界面。 That's text-oriented. 那是面向文本的。 To do graphics, you need another OS-specific interface. 要制作图形,您需要另一个特定于操作系统的界面。 So, you'd be looking at the API documentation for your OS. 因此,您需要查看操作系统的API文档。

BTW, the overlay graphics when you change the volume on your laptop are really special, IIRC. 顺便说一句,IIRC在您更改笔记本电脑的音量时的叠加图形确实很特别。 They're generated by your laptop itself, using System Management Mode - not the OS itself, and certainly not a program. 它们是由笔记本电脑本身使用系统管理模式生成的,而不是操作系统本身,当然也不是程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM