Console Applications

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UGFvbG8=?=

    Console Applications

    Is there a way of accessing the various graphics characters to facilitate
    drawing on the screen in console apps. I don't want to use the '-' (hyphen)
    character - I thoughtthere were some 'graphics' characters hat were
    available. I've looked at the Console Class specs and can't find anything
    about this. Any advice would be appreciated.

    Thanks
  • Jon Skeet [C# MVP]

    #2
    Re: Console Applications

    On Aug 7, 6:13 am, Paolo <Pa...@discussi ons.microsoft.c omwrote:
    Is there a way of accessing the various graphics characters to facilitate
    drawing on the screen in console apps. I don't want to use the '-' (hyphen)
    character - I thoughtthere were some 'graphics' characters hat were
    available. I've looked at the Console Class specs and can't find anything
    about this. Any advice would be appreciated.
    Have a look at unicode.org and see if you can find appropriate
    characters there. In particular http://www.unicode.org/charts/symbols.html
    might be helpful to you. However, I don't know offhand whether console
    apps will be able to support those characters - and it may very well
    depend on which font the user has specified for their console.

    Jon

    Comment

    • =?Utf-8?B?TW9ydGVuIFdlbm5ldmlrIFtDIyBNVlBd?=

      #3
      RE: Console Applications

      Hi Paolo,

      You can use all the characters in a codepage. These include extended
      characters like ╚ █ ▓ ┼ etc which you can make graphics with. Use an ascii
      lookup table to find the character number for these characters and write them
      by writing the character number while holding the ALT key [ALT] + [200] = ╚

      PS! The character number between 128 and 255 may change in various codepages
      so you may get a different character for the 200.

      Sample program:

      static void Main(string[] args)
      {
      Console.Backgro undColor = ConsoleColor.Bl ue;
      Console.Foregro undColor = ConsoleColor.Wh ite;

      Console.WriteLi ne("╔══╠â•â•â•â•â• â•â•â•â•â• â•—");
      Console.Write(" â•‘");
      Console.Foregro undColor = ConsoleColor.Re d;
      Console.Write(" Hello World ");
      Console.Foregro undColor = ConsoleColor.Wh ite;
      Console.WriteLi ne("â•‘");
      Console.WriteLi ne("╚══╠â•â•â•â•â• â•â•â•â•â• â•");
      Console.ResetCo lor();
      Console.Read();
      }

      --
      Happy Coding!
      Morten Wennevik [C# MVP]


      "Paolo" wrote:
      Is there a way of accessing the various graphics characters to facilitate
      drawing on the screen in console apps. I don't want to use the '-' (hyphen)
      character - I thoughtthere were some 'graphics' characters hat were
      available. I've looked at the Console Class specs and can't find anything
      about this. Any advice would be appreciated.
      >
      Thanks

      Comment

      • =?Utf-8?B?UGFvbG8=?=

        #4
        RE: Console Applications

        Morten: thank you. I thought there might be an extended character set (having
        used similar techniques in COBOL). I was worried might have to get into the
        Windows API!

        "Morten Wennevik [C# MVP]" wrote:
        Hi Paolo,
        >
        You can use all the characters in a codepage. These include extended
        characters like ╚ █ ▓ ┼ etc which you can make graphics with. Use an ascii
        lookup table to find the character number for these characters and write them
        by writing the character number while holding the ALT key [ALT] + [200] = ╚
        >
        PS! The character number between 128 and 255 may change in various codepages
        so you may get a different character for the 200.
        >
        Sample program:
        >
        static void Main(string[] args)
        {
        Console.Backgro undColor = ConsoleColor.Bl ue;
        Console.Foregro undColor = ConsoleColor.Wh ite;
        >
        Console.WriteLi ne("╔══╠â•â•â•â•â• â•â•â•â•â• â•—");
        Console.Write(" â•‘");
        Console.Foregro undColor = ConsoleColor.Re d;
        Console.Write(" Hello World ");
        Console.Foregro undColor = ConsoleColor.Wh ite;
        Console.WriteLi ne("â•‘");
        Console.WriteLi ne("╚══╠â•â•â•â•â• â•â•â•â•â• â•");
        Console.ResetCo lor();
        Console.Read();
        }
        >
        --
        Happy Coding!
        Morten Wennevik [C# MVP]
        >
        >
        "Paolo" wrote:
        >
        Is there a way of accessing the various graphics characters to facilitate
        drawing on the screen in console apps. I don't want to use the '-' (hyphen)
        character - I thoughtthere were some 'graphics' characters hat were
        available. I've looked at the Console Class specs and can't find anything
        about this. Any advice would be appreciated.

        Thanks

        Comment

        • =?Utf-8?B?UGFvbG8=?=

          #5
          Re: Console Applications

          Jon: thanks. There's a number there which might help.

          "Jon Skeet [C# MVP]" wrote:
          On Aug 7, 6:13 am, Paolo <Pa...@discussi ons.microsoft.c omwrote:
          Is there a way of accessing the various graphics characters to facilitate
          drawing on the screen in console apps. I don't want to use the '-' (hyphen)
          character - I thoughtthere were some 'graphics' characters hat were
          available. I've looked at the Console Class specs and can't find anything
          about this. Any advice would be appreciated.
          >
          Have a look at unicode.org and see if you can find appropriate
          characters there. In particular http://www.unicode.org/charts/symbols.html
          might be helpful to you. However, I don't know offhand whether console
          apps will be able to support those characters - and it may very well
          depend on which font the user has specified for their console.
          >
          Jon
          >

          Comment

          Working...