Hello :)
i worked many time with the Point structure on my projects
i noticed that there is a brother to Point calls PointF (its Point with floats as X & Y)

the thing i dont understand is why i saw a lot of drawing functions that uses RectangleF and PointF - why is that? the pixels are int... and if i need to draw a string for example why i need to put in a RectangleF as the borders of the string? why not Rectangle?

hope u understand the question
Thanks :)

Recommended Answers

All 2 Replies

Well, in the end it all boils down to pixels on a screen of course.
But with the advent of truetype fonts, the discrete handling(with integers) was not sufficient, hence the use of float.
You could perhaps read this article.

Well, in the end it all boils down to pixels on a screen of course.
But with the advent of truetype fonts, the discrete handling(with integers) was not sufficient, hence the use of float.
You could perhaps read this article.

It's not just for vector fonts; GDI+ as represented by the Graphics class does a lot more than twiddle pixels. It's also meant for printing and displaying to a variety of devices. To support drawing to a wider range of devices, GDI+ uses a few different but related coordinate spaces that allow you to easily rotate, scale, and translate your graphics in two dimensions.

OpenGL uses floating point coordinates for similar reasons.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.