默认坐标系
在二维空间里,C#和GDI+图形库有三个默认的坐标系统:世界(world)、页面(page)、设备(device)。世界坐标系是用来为特定的图形世界建模;页面坐标系用来在窗体、控件上绘制图形;设备坐标系用来在物理的设备上,如计算机屏幕、纸等。当你让C#从点(X1,Y1)到(X2,Y2)绘制一条直线,这个点在世界坐标系里。
你不能用世界坐标系在计算机屏幕上直接绘制图形对象。你需要做一系列的转换。一个转换是世界坐标系转换,即将时间坐标系转换为页面坐标系;另一个是页面转换,将页面坐标系转换为设备坐标系。
一般情况下,这三个坐标系的起到是点(0,0),即位于绘图区域的左上角。
这三个坐标系的默认单位是像素。