I have noticed that text drawn on a transparent region does not look crisp. It gets better the less transparent the background is, but it seems fonts only look crisp when they are drawn on non transparent backgrounds. Is there a trick to make this work properly?
It’s because it anti-aliases to the background color, ignoring the alpha byte. A typical transparent region is filled with transparent black, so the text anti-aliases to black. If you .Clear() the region with a fully transparent version of the same color as the text you’re drawing, it should look much better. For example:
region.Clear(&HFFFFFF00)
region.DrawText("My text", 0, 0, &HFFFFFFFF, font)
The same is true when drawing a bitmap to a transparent region with AlphaEnable set to True. I consider this to be a bug, and have reported it to Roku, suggesting that if the alpha byte is zero it should ignore the rest of the color for anti-aliasing, but to date they’ve disagreed… ![]()
You have just made my day! I appreciate the quick response and workaround! If I would have just changed the background to something like &HFF000000, I would have seen they anti-alias the font with the background color. Thanks again!
“TheEndless” wrote:
It’s because it anti-aliases to the background color, ignoring the alpha byte. A typical transparent region is filled with transparent black, so the text anti-aliases to black. If you .Clear() the region with a fully transparent version of the same color as the text you’re drawing, it should look much better. For example:region.Clear(&HFFFFFF00) region.DrawText("My text", 0, 0, &HFFFFFFFF, font)The same is true when drawing a bitmap to a transparent region with AlphaEnable set to True. I consider this to be a bug, and have reported it to Roku, suggesting that if the alpha byte is zero it should ignore the rest of the color for anti-aliasing, but to date they’ve disagreed…
