home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / mswindo / programm / misc / 1598 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.3 KB

  1. Path: sparky!uunet!olivea!decwrl!csus.edu!netcom.com!whedon
  2. From: whedon@netcom.com (Bill Whedon)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Reading in PAN FIles--Upside down--Why? What purpose?
  5. Keywords: DIB
  6. Message-ID: <-2hn!=r.whedon@netcom.com>
  7. Date: 31 Aug 92 20:18:45 GMT
  8. References: <koivu.715124832@ocoee>
  9. Distribution: comp
  10. Organization: Netcom - Online Communication Services  (408 241-9760 guest)
  11. Lines: 20
  12.  
  13. You need to look at SetMapMode, SetWindowOrg, SetWindowExt, SetViewportOrg,
  14. and SetViewportExt commands in the SDK or online docs.  Normally, the 0,0
  15. point on your display is the upper left corner.  If you feed it points
  16. originating at the the lower left, they will be, as you say, upside-down
  17. and backwards.
  18.  
  19. Try:
  20. SetMapMode(hDC,MM_ISOTROPIC);
  21. SetWindowExt(hDC,Xext,Yext); /* width and height of your bitmap */
  22. SetViewportExt(hDC,cxClient,-cyClient); /* width and height of client area */
  23. SetViewportOrg(hDC,0,cyClient);
  24.  
  25. Note that the setting in SetViewport of -cyClient puts you in the lower
  26. half of the coordinate system, and the cxClient keeps you to right of
  27. center, which is where I think you want to be.
  28.  
  29. SERMON:  "Programming Windows", Charles Petzold, Microsoft Press,
  30.          ISBN 1-55615-264-7 hath many examples, and Other Wonders.
  31. (here endeth the sermon)
  32. Cheers, and, have fun!
  33.