home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Original Code / Pages and Transforms / MobyDick / MobyDick.cs next >
Encoding:
Text File  |  2001-01-15  |  2.8 KB  |  58 lines

  1. //---------------------------------------
  2. // MobyDick.cs ⌐ 2001 by Charles Petzold
  3. //---------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Drawing.Drawing2D;
  7. using System.Windows.Forms;
  8.  
  9. class MobyDick: PrintableForm
  10. {
  11.      public new static void Main()
  12.      {
  13.           Application.Run(new MobyDick());
  14.      }
  15.      public MobyDick()
  16.      {
  17.           Text = "Moby-Dick by Herman Melville";
  18.      }
  19.      protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
  20.      {
  21.                // Insert RotateTransform, ScaleTransform, 
  22.                //   TranslateTransform, and other calls here.
  23.  
  24.           grfx.DrawString("Call me Ishmael. Some years ago\x2014never " +
  25.                           "mind how long precisely\x2014having little " +
  26.                           "or no money in my purse, and nothing " +
  27.                           "particular to interest me on shore, I " +
  28.                           "thought I would sail about a little and " +
  29.                           "see the watery part of the world. It is " +
  30.                           "a way I have of driving off the spleen, " +
  31.                           "and regulating the circulation. Whenever " +
  32.                           "I find myself growing grim about the " +
  33.                           "mouth; whenever it is a damp, drizzly " +
  34.                           "November in my soul; whenever I find " +
  35.                           "myself involuntarily pausing before " +
  36.                           "coffin warehouses, and bringing up the " +
  37.                           "rear of every funeral I meet; and " +
  38.                           "especially whenever my hypos get such an " +
  39.                           "upper hand of me, that it requires a " +
  40.                           "strong moral principle to prevent me " +
  41.                           "from deliberately stepping into the " +
  42.                           "street, and methodically knocking " +
  43.                           "people's hats off\x2014then, I account it " +
  44.                           "high time to get to sea as soon as I " +
  45.                           "can. This is my substitute for pistol " +
  46.                           "and ball. With a philosophical flourish " +
  47.                           "Cato throws himself upon his sword; I " +
  48.                           "quietly take to the ship. There is " +
  49.                           "nothing surprising in this. If they but " +
  50.                           "knew it, almost all men in their degree, " +
  51.                           "some time or other, cherish very nearly " +
  52.                           "the same feelings towards the ocean with " +
  53.                           "me.", 
  54.                           Font, new SolidBrush(clr), 
  55.                           new Rectangle(0, 0, cx, cy));
  56.      }
  57. }
  58.