Point and PointF struct

T

Tony Johansson

Why does it exist a struct PointF. I mean pixels are always in whole number
which is integer so it would be enough to use the existing Point struct that
take integer and skip this PointF struct.

//Tony
 
M

Marcel Müller

Tony said:
Why does it exist a struct PointF. I mean pixels are always in whole number
which is integer so it would be enough to use the existing Point struct that
take integer and skip this PointF struct.

/Pixels/ are countable, because they have finite size, but /points/ not.


Marcel
 
E

Ernst Sauer

Am 05.04.2011 18:30, schrieb Peter Duniho:
First, it's not true that "pixels are always in whole number". That's
why anti-aliasing works; one can speak of a fractional pixel.

But second, in .NET drawing is not even always done in a pixel-based
coordinate system. And for most other coordinate systems, floating point
is _much_ more appropriate.

Pete

Better questions: why PointF but not PointD (double) :)

Ernst
 
E

Ernst Sauer

Am 06.04.2011 16:17, schrieb Peter Duniho:
That's only one question. And why do you think it's better? .NET doesn't
support graphics for devices with more than 32 bits of precision for
pixel addressing, and 64-bit floating point would just be slower. How
would using System.Double be useful?

Pete

Because all my constructional nodes are double :)
In a C++ newsgroup I was told, that double is faster than float.
Is this wrong or is it different in C#.

Ernst
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top