I'd like to draw a progress bar with percentage in its center, but I'd like the text to have negative (contrasted) color of the background.
So the part of the text that is over the filled portion of ProgressBar would be white and the part over unfilled portion would be white.
I could do this simply by "cheating"
The performance impact of painting the text twice is negligible in this application, but I'm interested if there is some simple way to do it in two steps only (like having the progress bar somehow invert the already painted text) with blending.
What you're doing is fine. Old tricks like SetROP2() don't work anymore with text getting anti-aliased, especially with ClearType rendering. Getting the aliasing pixels with the wrong color is very noticeable. Graphics.CompositingMode accordingly doesn't support the effects anymore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With