|
|
1.1 ! root 1: Sample: World Coordinate Transformation ! 2: ! 3: Summary: ! 4: ! 5: The SDK sample named WXFORM provides a demonstration of the ! 6: new world-coordinate transformation. This sample displays a ! 7: rectangle in world coordinates and a matrix containing the ! 8: transform values. Users can directly manipulate the ! 9: rectangle and see the effect on the transformation, or they ! 10: can set the transformation and see the effect on the ! 11: rectangle. ! 12: ! 13: More Information: ! 14: ! 15: The program begins by setting the viewport origin to the ! 16: center of the client area. It then draws a rectangle in ! 17: world coordinate space from the point (0, 0) to the point ! 18: (100, 100). The user can directly manipulate this rectangle ! 19: by using the left and right mouse buttons. Specific actions ! 20: are described more fully in the "Direct Manipulation Help" ! 21: dialog box. ! 22: ! 23: There is a second dialog box titled "World Transform." This ! 24: shows the values of the eM11, eM12, eM21, eM22, eDx, and eDy ! 25: fields in the XFORM structure retrieved by calling the ! 26: GetWorldTransform function. By choosing the buttons on this ! 27: dialog box, the user can cause a SetWorldTransform to occur ! 28: in the program. ! 29: ! 30: There are three coordinate systems of interest in this ! 31: sample. The first one is the world coordinate system, which ! 32: is new to Win32. These points are ultimately mapped to the ! 33: second coordinate system, device coordinates, before being ! 34: painted in the window. This program must also use a third ! 35: coordinate system, screen coordinates, for certain ! 36: interactions with the mouse pointer. ! 37: ! 38: There is a third dialog box titled "Mouse Position" that ! 39: shows the location of the cursor in all three of these ! 40: coordinate systems. The device coordinates are relative to ! 41: the upper-left corner of the client area. They are not ! 42: relative to the viewport origin. ! 43: ! 44: The following is a list of the Win32 API functions used in ! 45: this sample: ! 46: ! 47: BeginPaint GetDC LocalFree SelectObject ! 48: ClientToScreen GetDlgItemtext LocalHandle SendMessage ! 49: CreateDialog GetMessage LPtoDP SetCapture ! 50: CreatePen GetStockObject ModifyWorldTransform SetClassLong ! 51: CreateWindow GetViewportOrgEx MoveToEx SetCursorPos ! 52: DeleteObject GetWorldTransform OffsetRect SetDlgItemText ! 53: DispatchMessage InvalidateRect PostQuitMessage SetROP2 ! 54: DPtoLP LineTo PtInRect SetViewportOrgEx ! 55: EndPaint LoadCursor Rectangle SetWorldTransform ! 56: GetClassLong LoadIcon ReleaseCapture ShowWindow ! 57: GetClientRect LocalAlloc ReleaseDC TranslateMessage ! 58: UpdateWindow ! 59: ! 60:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.