Question

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?

Was it helpful?

Solution

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top