如何在Android中使用的onTouchEvent突出这一PDF页面 [英] How to Highlight this pdf page using Ontouchevent in android

查看:177
本文介绍了如何在Android中使用的onTouchEvent突出这一PDF页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里,我想强调的机器人使用的onTouchEvent本文

Here I want to highlight this text using onTouchevent in android

推荐答案

您可以使用OnTouchListener获得该事件的x和y。然后绘制屏幕的位图,并使用bitmap.getPixel基于信届的你的信的尺寸的左上角显示上,看是否它旁边的一个字母的(多个)也没有spaces.Finally,把黄色白色和黑色文字,或者你希望突出的那些之间的矩形

You could use OnTouchListener to get the x and y of the event. Then drawing the screen to a bitmap and using bitmap.getPixel based on the top left display of the letter nd the size of your letters, to see if the next letter(s) next to it are also not spaces.Finally, put a yellow rectangle in between the white and the black lettering or the ones you wish to have highlighted.

这篇关于如何在Android中使用的onTouchEvent突出这一PDF页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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