I'm trying to subclass (because thats probably the easiest way to do it) UILabel so it's text color is negative to the part of the background image it overlays. I also have an approximate idea how to do that, but cannot transform it into code.
kCGBlendModeDifference
in some way perhaps? drawRect
or drawTextInRect
methods. The usage of this would probably be something like
UIImage
UIImageView
UILabel
subclass with the inverted text color relative to the part of the image the UILabel
will be placed in UILabel
as a subview of the UIImageView
I can't approximate how quick this will be while scrolling, however this could be solved by drawing the text right into the UIImage
, as it will be static. If the UIImageView
holding the label would be put into a UIScrollView
, would it be redrawn upon every scroll?
Thank you a lot in advance!
Check out the answer for my question: drawRect drawing 'transparent' text?
There's a number of answer including a great open-source project you can use from Robin Senior.
Enjoy!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.