PageScale: Gets or sets the ratio between the world units of this Graphics and the page units.
PageUnit: Gets or sets the unit of measure used for page coordinates in this Graphics.
Words don't say much, on the code:
Private voidForm1_paint (Objectsender, PaintEventArgs e) {Graphics DC=E.graphics; dc. PageUnit= GraphicsUnit.Pixel;//page Coordinatesdc. PageScale =0.5f;//World Coordinate and page coordinate scale factorPen P=NewPen (color.red); intStartX = -; intStarty = -; Point StartPoint=NewPoint (StartX, starty); for(inti =0; I < -; ++i) {DC. DrawLine (P, StartPoint,NewPoint (StartX +I, starty)); } }
Again
PageScale = 0.5 PageScale = 1 PageScale = 2
Visible from above, PageUnit = GraphicsUnit.Pixel, that is, when displayed in pixels, the program draws 100 coordinate positions
PageScale = 1, a coordinate position corresponds to one pixel, so the length of the line is displayed as 100 pixels
PageScale = 0.5, a coordinate corresponds to 0.5 pixels, so the length of the line is displayed as 50 pixels
PageScale = 2, a coordinate corresponds to 2 pixels, so the length of the line is displayed as 200 pixels (beyond the window Size: D), and the width of the visible line becomes 2 pixels.
Comprehensive: page coordinates = WORLD coordinates * pagescale!!! I understand the world coordinates that are logical coordinates, the page coordinates are physical coordinates or called device coordinates!
C # World coordinates page coordinates pageunit PageScale