Article View: comp.os.ms-windows.programmer.misc
Article #2359Re: Changing horses in midstream.
From: Tom W. Brown
Date: Tue, 26 Jan 1993 21:33
Date: Tue, 26 Jan 1993 21:33
35 lines
2327 bytes
2327 bytes
In article <753@lax.lax.pe-nelson.com>, twbrown@PE-Nelson.COM (Tom W. Brown) writes: |> In article <1k1886INNbek@iguana.cis.ohio-state.edu>, guzman@cis.ohio-state.edu (jonatan guzman) writes: |> |> ...well, just about! |> |> |> |> I have a program that needs to print a number of documents, and needs to change |> |> the mode (landscape/portrait) depending on the document. Anybody out there |> |> know how to do this? |> |> There are two basic approaches: |> |> 1) Always plot in what is essentially portrait mode and tell the printer |> driver to flip into Portrait or Landscape mode via a call to |> ExtDeviceMode(). See documentation for that call for more info. |> |> 2) Always assume that the printer is in Portrait mode and setup your |> mapping mode to give the effect of portrait or landscape. |> |> I've done it both ways. (1) may be easier if you've already got the graphics |> code written and it makes hard to change assumptions about the mapping mode. |> (2) can be pretty powerful since you can do fancy (albeit mostly useless :-) |> things like printing upside-down and backwards by altering your window and |> viewport mapping. This is, of course, a little understated (must have grabbed the decaf by mistake :-). For (2), you need to parameterize your drawing routines so that they know whether to do portrait or landscape mode. For landscape mode you must swap x and y values to the GDI calls in an appropriate fashion (as well as rotating fonts appropriately). ---------------------------------------------------------------------------- Tom Brown | "She turned me into a newt... PE Nelson Systems | ... I got better" twbrown@pe-nelson.com | Monty Python and the Holy Grail ----------------------------------------------------------------------------
Technical Details
Message-ID:
<754@lax.lax.pe-nelson.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrownReferences:
<1k1886INNbek@iguana.cis.ohio-state.edu> <753@lax.lax.pe-nelson.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown From: twbrown@PE-Nelson.COM (Tom W. Brown) Newsgroups: comp.os.ms-windows.programmer.misc Subject: Re: Changing horses in midstream. Message-ID: <754@lax.lax.pe-nelson.com> Date: 26 Jan 93 21:33:11 GMT References: <1k1886INNbek@iguana.cis.ohio-state.edu> <753@lax.lax.pe-nelson.com> Sender: news@lax.pe-nelson.com Organization: PE-Nelson Lines: 35