Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.9 KiB

  1. /*++
  2. Copyright (C) 1993-1999 Microsoft Corporation
  3. Module Name:
  4. ctrlwin.cpp
  5. Abstract:
  6. Window procedure for the sysmon.ocx drawing window and support
  7. functions.
  8. --*/
  9. #include "polyline.h"
  10. /*
  11. * CPolyline::Draw
  12. *
  13. * Purpose:
  14. * Paints the current line in the polyline window.
  15. *
  16. * Parameters:
  17. * hDC HDC to draw on, a metafile or printer DC.
  18. * fMetafile BOOL indicating if hDC is a metafile or not,
  19. * so we can avoid operations that RIP.
  20. * fEntire BOOL indicating if we should draw the entire
  21. * figure or not.
  22. * pRect LPRECT defining the bounds in which to draw.
  23. *
  24. * Return Value:
  25. * None
  26. */
  27. void
  28. CPolyline::Draw(
  29. HDC hDC,
  30. HDC hAttribDC,
  31. BOOL fMetafile,
  32. BOOL fEntire,
  33. LPRECT pRect)
  34. {
  35. RECT rc;
  36. if (!fMetafile && !RectVisible(hDC, pRect))
  37. return;
  38. SetMapMode(hDC, MM_ANISOTROPIC);
  39. //
  40. // Always set up the window extents to the natural window size
  41. // so the drawing routines can work in their normal dev coords
  42. //
  43. // Use client rect vs. extent rect for Zoom calculation.
  44. // Zoom factor = prcPos / Extent, so pRect/ClientRect.
  45. /********* Use the extent rect, not the window rect *********/
  46. // Using rectExt makes Word printing correct at all zoom levels.
  47. rc = m_RectExt;
  48. // GetClientRect(m_pCtrl->Window(), &rc);
  49. /************************************************************/
  50. SetWindowOrgEx(hDC, 0, 0, NULL);
  51. SetWindowExtEx(hDC, rc.right, rc.bottom, NULL);
  52. SetViewportOrgEx(hDC, pRect->left, pRect->top, NULL);
  53. SetViewportExtEx(hDC, pRect->right - pRect->left,
  54. pRect->bottom - pRect->top, NULL);
  55. m_pCtrl->InitView( g_hWndFoster);
  56. m_pCtrl->Render(hDC, hAttribDC, fMetafile, fEntire, &rc);
  57. return;
  58. }