Point and PointF struct

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
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
 
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
 
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
 
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
 
Back
Top