GIDForums  

Go Back   GIDForums > Computer Programming Forums > .NET Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 07-Mar-2009, 11:42
Howard_L Howard_L is online now
Regular Member
 
Join Date: Apr 2007
Location: Maryland/PA, USA
Posts: 800
Howard_L is a jewel in the roughHoward_L is a jewel in the roughHoward_L is a jewel in the rough

Console character mode graphics in C#


Since C# is so COOL and all...
Are there cross-platform tools in C# to 'handle' character mode graphics?

Or do you have to still go to either MS API or ncurses.

Know a good reference for any methods?

('course now I have to watch how I use 'method'
(What are they skaters? dude , I took a method to a 270 face-plant... it was awesome! ; ) )
  #2  
Old 16-Apr-2009, 23:40
Howard_L Howard_L is online now
Regular Member
 
Join Date: Apr 2007
Location: Maryland/PA, USA
Posts: 800
Howard_L is a jewel in the roughHoward_L is a jewel in the roughHoward_L is a jewel in the rough

Re: Console character mode graphics in C#


Just for the record:
I found that console graphic functions are right in with the other Console methods.
A quick demo:
CPP / C++ / C Code:
 using System;  /* congraphtest.cs */

namespace mano
{
  class MainClass
  {
    public static void Main(string[] args)
    {
      int x= 10, y= 5;
      Console.WriteLine("** FC6-linux Mono Console Graphics Test **");
      Console.WriteLine("This will show up on console before graphics mode.");
      
      /* from this point on the console is in graphic mode */
      Console.Clear();  
      Console.SetCursorPosition( x, y);
      Console.Write("This should begin at position x={0}, y={1}.\n", x, y);
      Console.Write("..and I bet this is at the beginning of the next line.\n");
      Console.Read();  /* need to pause here to view console */
    }
  }
} 

A reference for the console functions including the graphic functions is:
http://msdn.microsoft.com/en-us/libr...e_members.aspx

The above compiled fine in windows using csc on command line.
I forget what .NET I use, think it's the latest.

But in Linux/Mono I had some more learning to do:
The problem was that I could NOT compile console graphic functions with
the normal mono mcs line eg:

> mcs congraphtest.cs
congraphtest.cs(10,7): error CS0117: `System.Console' does not contain a definition for `Clear'
congraphtest.cs(11,7): error CS0117: `System.Console' does not contain a definition for `SetCursorPosition'
Compilation failed: 2 error(s), 0 warnings

So I did some research:
My Installed mono components so far are from my FC6 disks :

mono-core-1.1.17.1-3.fc6.i386.rpm
mono-data-1.1.17.1-3.fc6.i386.rpm
mono-data-sqlite-1.1.17.1-3.fc6.i386.rpm
mono-web-1.1.17.1-3.fc6.i386.rpm

Finally I read about different compile commands to use here:

http://www.go-mono.com/docs/monodoc....em.Console%2f*

So all I needed to do differently was this:
Code:
> gmcs congraphtest.cs // to compile > mono congraphtest.exe // to run ** FC6-linux Mono Console Graphics Test ** This will show up on console before graphics mode.
 
 

Recent GIDBlogToyota - 2009 May Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change 98 console character size in program? Howard_L C Programming Language 1 25-Apr-2007 15:25
Graphics , console -XXX- C++ Forum 2 09-Mar-2007 08:21
need help with a console menu system BullBuchanan C++ Forum 6 20-Aug-2006 15:46
Windows XP - Graphics in DOS console? LeFunkster C Programming Language 5 14-May-2005 01:01
printing integers in graphics mode enggwaqas C Programming Language 4 04-Oct-2004 21:47

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 10:13.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.