home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / mswindo / programm / misc / 5394 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  2.2 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Changing horses in midstream.
  5. Message-ID: <754@lax.lax.pe-nelson.com>
  6. Date: 26 Jan 93 21:33:11 GMT
  7. References: <1k1886INNbek@iguana.cis.ohio-state.edu> <753@lax.lax.pe-nelson.com>
  8. Sender: news@lax.pe-nelson.com
  9. Organization: PE-Nelson
  10. Lines: 35
  11.  
  12. In article <753@lax.lax.pe-nelson.com>, twbrown@PE-Nelson.COM (Tom W. Brown) writes:
  13. |> In article <1k1886INNbek@iguana.cis.ohio-state.edu>, guzman@cis.ohio-state.edu (jonatan guzman) writes:
  14. |> |> ...well, just about!
  15. |> |> 
  16. |> |> I have a program that needs to print a number of documents, and needs to change
  17. |> |> the mode (landscape/portrait) depending on the document. Anybody out there 
  18. |> |> know how to do this?
  19. |> 
  20. |> There are two basic approaches:
  21. |> 
  22. |>    1) Always plot in what is essentially portrait mode and tell the printer
  23. |>       driver to flip into Portrait or Landscape mode via a call to
  24. |>       ExtDeviceMode().  See documentation for that call for more info.
  25. |> 
  26. |>    2) Always assume that the printer is in Portrait mode and setup your
  27. |>       mapping mode to give the effect of portrait or landscape.
  28. |> 
  29. |> I've done it both ways.  (1) may be easier if you've already got the graphics
  30. |> code written and it makes hard to change assumptions about the mapping mode.
  31. |> (2) can be pretty powerful since you can do fancy (albeit mostly useless :-)
  32. |> things like printing upside-down and backwards by altering your window and
  33. |> viewport mapping.
  34.  
  35. This is, of course, a little understated (must have grabbed the decaf by
  36. mistake :-).  For (2), you need to parameterize your drawing routines so that
  37. they know whether to do portrait or landscape mode.  For landscape mode
  38. you must swap x and y values to the GDI calls in an appropriate fashion (as
  39. well as rotating fonts appropriately).
  40.  
  41.  
  42. ----------------------------------------------------------------------------
  43. Tom Brown               |  "She turned me into a newt...
  44. PE Nelson Systems       |                                  ... I got better"
  45. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  46. ----------------------------------------------------------------------------
  47.