如何选择GDI或DirectX绘制的文本? [英] How to select text drawn by GDI or DirectX?

查看:58
本文介绍了如何选择GDI或DirectX绘制的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

- 我正在考虑像谷歌Chrome这样的网络浏览器这样的软件。我很确定它在Windows上由DirectX和GDI绘制。我看到它可以在Web浏览器上选择文本,但是当我使用GDI和DirectX时,我无法选择任何文本。


- 那么他们如何实现这种选择文本?

解决方案

您好


这是很多工作。你需要处理像WM_MOUSEMOVE和WM_LBUTTONDOWN这样的鼠标事件。并且您的应用程序应该保留其在内存中显示在屏幕上的内容(包括位置)的信息。然后...根据鼠标坐标搜索
正确的文本并将其绘制为选中...这也必须通过游标进行游标和选择。因为DirectX / GDI打印的屏幕上的所有内容都只是一张图片...


Rudolf



- I'm thinking about the software like some web brower like Google Chrome. I'm pretty sure on Windows it drawn by DirectX and GDI. I saw it can select text on the web browser but when I use GDI and DirectX, I cannot select any text.

- So how they can implement the kind of select text?

解决方案

Hi

That's a lot of work. You need to handle mouse events like WM_MOUSEMOVE and WM_LBUTTONDOWN and things like that. And you're application should keep an information of what it printed on the screen in the memory (including the position). Then... search the correct text according to the mouse coordinates and draw it selected... and this has to be done also for cursors and selections by cursors. Because everything on the screen that has been printed by DirectX/GDI is just a picture...

Rudolf


这篇关于如何选择GDI或DirectX绘制的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆