| Message |
There is always a solution. However it may involve trade-offs. Speed. Memory. Complexity. Visibility. Coding time.
Drawing text on a busy background is always going to be a challenge. Personally I wouldn't have a transparent window on top of another one, I think that just adds a layer of complexity. For one thing, what if you want to move it? Also, the transparency is either on or off, giving you a sharp edge.
One approach would be to "punch out" the background, perhaps by drawing the text in white over the background, perhaps offset one pixel up and left, and then one pixel down and right. Then draw the black text on top in the middle.
Or, fade the background a bit with a blended in rectangle, lowering the intensity of the background. Or more simply, just block out the background with black, white, gray, yellow or whatever, and draw the text on that.
What could look nice is blending in a soft-edged rectangle onto the main window, giving a black background to the text, but without the hard borders. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|