home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / misc / 4192 < prev    next >
Encoding:
Text File  |  1992-12-13  |  2.1 KB  |  50 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!emr1!jagrant
  3. From: jagrant@emr1.emr.ca (John Grant)
  4. Subject: Re: Window's co-ordinates ?
  5. Message-ID: <1992Dec14.003236.14795@emr1.emr.ca>
  6. Organization: Energy, Mines, and Resources, Ottawa
  7. References: <13DEC199204274690@vms1.iscs.nus.sg>
  8. Date: Mon, 14 Dec 1992 00:32:36 GMT
  9. Lines: 39
  10.  
  11. In article <13DEC199204274690@vms1.iscs.nus.sg> nuscss1@vms1.iscs.nus.sg (Vax BULLET-IN-Board SysOps) writes:
  12. >    Hi Gurus,
  13. >
  14. >    I have this app in which some text is positioned and printed
  15. >    in a window using the TextOut function.  Mapping mode is the
  16. >    default MM_TEXT. In normal VGA mode, it
  17. >    works flawlessly. BUT, when I switch to SuperVGA with LARGE fonts,
  18. >    the text are wrongly positioned ! However, SuperVGA with SMALL fonts
  19. >    presents no such problem. 
  20. >
  21. >    I'm really puzzled at this. Does the way Windows handles coordinates
  22. >    differ with different font sizes ? I've always thought that TextOut
  23. >    uses the logical coordinates, and therefore, Windows should be able
  24. >    to take care of any differences. Apparently I was mistaken.
  25. >
  26. >    Any advice/tips/help would be greatly appreciated.
  27. >    Thanx. 
  28. >
  29. >    BTW, I've tried this out on a Paradise SuperVGA and a Taiwanese
  30. >    Tseng Labs SuperVGA card, installed the 800x600 large font drivers,
  31. >    and both had the same problem. 
  32.  
  33.     In MM_TEXT mode, 1 logical unit = 1 physical unit (pixel).
  34.     If you have more pixels in a higher res card, then you
  35.     also have more logical units.  You should use a different
  36.     mapping mode like MM_ISOTROPIC where you can set specific
  37.     logical co-ordinate limits which map to the physical limits.
  38.     Use GetClientRect to get the size of the window and then map
  39.     perhaps x=[0,1000] y=[0,1000] logical units to the physical
  40.     no. of pixels.  I forget how to do this, but Petzold's
  41.     "Programming Windows 3.1" shows how. I think it uses things
  42.     like SetWindowExt, SetViewportExt,SetWindowOrg etc.  Then
  43.     you can use logical co-ordinates [0,1000] and it will always
  44.     come out right.
  45.      
  46. -- 
  47. John A. Grant                        jagrant@emr1.emr.ca
  48. Airborne Geophysics
  49. Geological Survey of Canada, Ottawa
  50.