There are many coordinate systems in Vc, and sometimes it is difficult to clearly distinguish between them. In general, there are logical coordinates and device coordinates, and there are intersections between coordinates.
Logical coordinates are the coordinates used by the system as records. They are widely used. As long as the original data has such logical coordinates, they are the criteria and basis for us to convert the coordinates of devices. When the client area does not have the scroll function, the device coordinates are consistent with the logical coordinates.
Device coordinate, also known as physical coordinate, is the coordinate on the output device. Device coordinates on the screen are usually called screen coordinates. The device coordinate specifies the object position based on the horizontal distance and vertical distance between the object and the upper left corner of the window, expressed in pixels. the X axis of the device coordinate is positive to the right, and the Y axis is positive downward, the coordinate origin is located in the upper left corner of the window.
The customer zone coordinates are relative to the device coordinates for the so-called desktop. There are several mode conversion problems.
1. ing mode: the conversion between pixel coordinates of an image to a ground point and the selection of the ing mode of device coordinates
2. Conversion of logical coordinates and device coordinates: You can use the CDC function dptolp () to convert device coordinates into logical coordinates, or use lptodp () to convert logical coordinates into device coordinates.
3. screen coordinates and client region coordinate coordinates: screentoclient and clienttoscreen
4. coordinate origin definition: Sometimes, for visual convenience, the coordinate origin is usually set to a place outside the upper left corner. Even the image coordinates are not necessarily defined in the upper left corner:: setviewportorg () function