获取文本元素中特定字符的x,y坐标 [英] Getting the x,y coordinates for a specific character within a text element
本文介绍了获取文本元素中特定字符的x,y坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以使用字符索引值来获取坐标(屏幕或相对于文本元素)吗?
假设我有一个带有文字"ABCDE"的输入/文本区域。
我可以得到"B"的坐标吗?如果我给索引1(这是char索引)?
我试图在使用mshtml库的BHO中执行此操作。
谢谢!
Hi,
Is it possible to get the coordinates (either screen or relative to the text element) using a character index value?
e.g.
Say I have an input/textarea with text "ABCDE"
Can I get the coordinate for "B" if I give the index 1 (which is the char index)?
Im trying to do this within a BHO using mshtml library.
Thanks!
推荐答案
您可以使用IHTMLCaret,IMarkupPointer和IHTMLTxtRange接口收集此信息。
You can use the IHTMLCaret, IMarkupPointer and IHTMLTxtRange Interfaces to gather this infos.
这篇关于获取文本元素中特定字符的x,y坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文