Graphics Coordinates

I l @ ve RuBoard

Objects are painted onto the screen using coordinates that are mapped to no less than three systems. The World Coordinate system, which is an abstract concept of space within the graphics system, the Page Coordinate system, which is another abstract concept of physical dimension on a hypothetical page, and the Device Coordinate system, which is tied to the physical properties of the screen or printer upon which the graphics are rendered. To display anything onscreen, the graphical data that you write to the GDI+ graphics object has to be transformed several times. The reason for this is to allow you to deal with graphics in a device-independent way. For example, if you place a shape or some text in World Coordinates, you might want to ensure that the resulting graphic is displayed as though it were on a standard A4 sheet of paper. The image must look as if it's on A4 both on the monitor and on any printer of any resolution. The World Coordinate is, therefore, mapped to a Page Coordinate that represents an 8 1/2" by 11" physical measurement. When the system comes to display the A4 page, the monitor might have a resolution of 72 dots per inch (DPI) ”printer A has a resolution of 300 DPI and printer B has a resolution of 1200 by 400 DPI. Page space, a physical measurement, then needs to be mapped to Device Space so that, in reality, the monitor maps 8.5 inches across the page to 612 pixels on the monitor ”2550 pixels on printer A and 10200 pixels on printer B.

GDI+ allows you to set the way that objects are transformed from the world to the page using the PageUnit , PageUnit , PageScale , and PageScale properties. You have no control over the transformation to device space. That all happens in the device drivers themselves . You can, however, read the device's DPI with the DpiX and DpiY properties.

We'll examine coordinate transformations in detail later in this chapter.

I l @ ve RuBoard


C# and the .NET Framework. The C++ Perspective
C# and the .NET Framework
ISBN: 067232153X
EAN: 2147483647
Year: 2001
Pages: 204

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net