Main Site Documentation

System.Drawing


#1

Good morning folks!

As usual, I have a question that is from my curious mind.

System.Drawing
public void DrawString(string s, Font font, Brush brush, float x, float y);

Why are X and Y a float?

Thanks.


#2

this allows for drawing between pixels? :hugs:


#3

I have wondered that myself.


#4

We use float because that is what the desktop uses. They use it for, as Mike said, subpixel drawing. Note that TinyCLR doesn’t support that functionality at the moment.


#5

Thanks…
Like Mike said.

I have to admit I cannot wrap my mind around drawing between pixels… Ya can’t see there, I think…

Something like space/time I guess.


#6

In the end of course it’s all rendered down to the integer pixels we all know, but subpixel drawing is used for things like blending, antialiasing, curves, smoothing, and so on.