Notifications
Clear all

[Closed] DrawText with the correct alpha ?

Hello Denis,

Hmm, that’s a strange one. Looks like it doesn’t like rendering the text over a transparent background as it’s not anti-aliasing the edges properly. Supplying a background colour other than transparent for the drawstring method and gr.TextRenderingHint.AntiAliasGridFit (imho) seemed to give the best text rendering,but you’ve probably noticed that already. For what you are doing is seems it’s about as good as it can be as the drawstring method disregards any antialiasing with a transparent background.

thanks for that Denis works really well, word of warning for anyone else deciding to use this routine…

change


--	deletefile temp

to


  deletefile temp

or like me you could end up with over 100,000 4k png files in your temp dir And It was only by chance that I had a look in that folder for something else !

p.s I don’t have any issue with the text render quality, though i changed the code to render white on black and use a custom blend multiply function for pasteBitmap.

Page 2 / 2