Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

drawing a string on the screen C#

Tags:

c#

winforms

gdi+

I would like to simply draw a string (if possible in a specific font and size) on the screen (at a specific location). I am within a C# windows forms application. Unfortunately, I could not found any hint on how to do this in the web.

Please help!

Christian

like image 875
Christian Avatar asked Nov 21 '25 03:11

Christian


1 Answers

To draw a string outside of your window, you'll have to CREATE a new window, set it's mask to some color (say magenta) and then draw text onto it - you can use simple label here.

Set your window border style to None, and there you go.

In other words, there is no way of displaying 'free text' without window attached.

For masking color, use 'transparency color' or similar property (I will look up into it later - have no VS at hand)

like image 191
Daniel Mošmondor Avatar answered Nov 23 '25 17:11

Daniel Mošmondor