all groups > dotnet drawing api > april 2007 >
You're in the

dotnet drawing api

group:

why .Net Matrix use float, but not double



why .Net Matrix use float, but not double zade
4/24/2007 2:54:57 AM
dotnet drawing api: ..Net Matrix class use float to store data, and Graphics use it to map
points from logical to device.
My Geometry data is double , and when I use Graphics to draw them, I
have to translate. The effect is not good as well when the data is too
big or too small. So I have to define my own Matrix class.
My question is : why .Net Matrix use float, but not double?
Thanks!
Re: why .Net Matrix use float, but not double Chris Taylor
4/25/2007 10:25:14 PM
I am no expert at this, but my guess would be to reduce the amount of data
that is shifted around in with in the system where the system includes the
across the system bus. Considering that the majority of the processing is
carried out on the video card the data needs to be moved from system memory
to video memory. Now I am sure you would argue that GDI+ does not currently
have any or much hardware acceleration, but I guess the structures are
optimized for that eventuality.

--
Chris Taylor
http://dotnetjunkies.com/weblog/chris.taylor


[quoted text, click to view]
Re: why .Net Matrix use float, but not double Bob Powell [MVP]
4/29/2007 12:10:24 AM
I believe that at the time that the system was created floats were
considered as being enough and doubles had a performance hit for the
graphics cards that were _supposed_ to be accellerated for GDI+. At the end
of the day accelleration never materialised and GDI+ was never updated.

Even with floats however, the dimensions possible are impressive.

http://www.bobpowell.net/extents.htm


--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


[quoted text, click to view]
AddThis Social Bookmark Button