문제

I am developing a book app. Book pages are images. At a time one image is shown on iphone screen. Image contains lines(Paragraphs). I want to highlight the whole paragraph on touch on that. Is it possible to highlight the paragraph or make overlay on the whole paragraph or change the color of that paragraph. Any Help please?

도움이 되었습니까?

해결책

As your book page is an image, the only way you can do it is to either change the image or add a view on top with a color and an alpha value. With the latter you also overlay the letters of course, so the effect will kind of blurry your text.

Next to that, recognising the paragraph won't be trivial, depending on your image quality. The same counts for changing the image - if your background is not a clean color you have to introduce some threshold for which color is the background color and should be changed to the highlight color.

For how to change the color of specific pixels in an UIImage see here:

iPhone : How to change color of particular pixel of a UIImage?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top