kleuren in C++

Pagina: 1
Acties:

  • wigwam
  • Registratie: Oktober 2001
  • Laatst online: 22-08 22:08
Hoe kan je kleuren gebruiken in C++ en welke liberary's moet in #include voor het gebruik.

  • iznogood
  • Registratie: September 2001
  • Niet online
Waar wil je de kleuren gebruiken ? Op het form ?

Just as Good


  • whoami
  • Registratie: December 2000
  • Laatst online: 07-09 19:30
Borland C++ onder DOS?

-> #include <conio.h>

end de functies: cputs() textcolor() bekijken.

https://fgheysels.github.io/


  • wigwam
  • Registratie: Oktober 2001
  • Laatst online: 22-08 22:08
nee onder c++ builder. Niet voor het form maar gewoon voor in een programma

Verwijderd

je bent echt te onduidelijk...

  • wigwam
  • Registratie: Oktober 2001
  • Laatst online: 22-08 22:08
oke ik heb een C++-programma. Dat wil ik op vrolijken met wat kleuren. Een dos box zonder kleuren is wel heel erg zwart. Hoe moet ik dat doen. In pascal had je textcolor. Maar wat ik gebruiken in C++. Is dit duidelijker

  • DeGroninger2
  • Registratie: Mei 2002
  • Laatst online: 10-08 08:27
<betweterig>
Je zou kunnen beginnen met de handleiding lezen of de Help van Builder... :) :)
</betweterig>
Ben in een goede bui, dus dat heb ik al even voor je gedaan:

---

Console I/O Routines

Syntax

#include <conio.h>
void textcolor(int newcolor);

Description

Selects new character color in text mode.

Note:Do not use this function for Win32s or Win32 GUI applications.

textcolor selects the foreground character color. This function works for the console output functions. newcolor selects the new foreground color. You can set newcolor to an integer as given in the table below, or to one of the symbolic constants defined in conio.h. If you use symbolic constants, you must include conio.h.

Once you have called textcolor, all subsequent functions using direct video output (such as cprintf) will use newcolor. textcolor does not affect any characters currently onscreen.

The following table lists the allowable colors (as symbolic constants) and their numeric values:

Symbolic constantNumeric value

BLACK0
BLUE1
GREEN2
CYAN3
RED4
MAGENTA5
BROWN6
LIGHTGRAY7
DARKGRAY8
LIGHTBLUE9
LIGHTGREEN10
LIGHTCYAN11
LIGHTRED12
LIGHTMAGENTA13
YELLOW14
WHITE15
BLINK128

You can make the characters blink by adding 128 to the foreground color. The predefined constant BLINK exists for this purpose.

For example:

textcolor(CYAN + BLINK);

Note:Some monitors do not recognize the intensity signal used to create the eight light colors (8-15). On such monitors, the light colors are displayed as their dark equivalents (0-7). Also, systems that do not display in color can treat these numbers as shades of one color, special patterns, or special attributes (such as underlined, bold, italics, and so on). Exactly what youll see on such systems depends on your hardware.

Return Value

None.

*D

  • XTerm
  • Registratie: Juli 2001
  • Laatst online: 10-06-2025
Is er geen port van ncurses ? Dat is VEEL geavanceerder dan die dos rommel :)

  • whoami
  • Registratie: December 2000
  • Laatst online: 07-09 19:30
Op zaterdag 25 mei 2002 13:06 schreef wigwam het volgende:
oke ik heb een C++-programma. Dat wil ik op vrolijken met wat kleuren. Een dos box zonder kleuren is wel heel erg zwart. Hoe moet ik dat doen. In pascal had je textcolor. Maar wat ik gebruiken in C++. Is dit duidelijker
dus toch een DOS-programma in een Borland C++ omgeving.

https://fgheysels.github.io/


  • wigwam
  • Registratie: Oktober 2001
  • Laatst online: 22-08 22:08
als ik het nu onder linux probeer dan werkt conio.h niet want die herkent hij niet.

  • whoami
  • Registratie: December 2000
  • Laatst online: 07-09 19:30
Tuurlijk niet, conio.h is een header file specifiek voor DOS en je had het over een dos - box...

https://fgheysels.github.io/


  • wigwam
  • Registratie: Oktober 2001
  • Laatst online: 22-08 22:08
sorry :'(. Ik bedoelde kleuren in linux

  • Lone Gunman
  • Registratie: Juni 1999
  • Niet online
wat xterm al zei: gebruik gewoon ncurses.
en er is idd een port voor dos. maar die heb je toch niet nodig aangezien je linux draait ;)

mzzl, lone

Experience has taught me that interest begets expectation, and expectation begets disappointment, so the key to avoiding disappointment is to avoid interest.


  • wigwam
  • Registratie: Oktober 2001
  • Laatst online: 22-08 22:08
moet ik daar nog speciale #include voor meegegeven.

  • wigwam
  • Registratie: Oktober 2001
  • Laatst online: 22-08 22:08
Op zaterdag 25 mei 2002 16:15 schreef wigwam het volgende:
moet ik daar nog speciale #include voor meegegeven.
Vraagje Lone Gunman hoe gebruik ik dat dan ncurses voor die kleuren.

  • whoami
  • Registratie: December 2000
  • Laatst online: 07-09 19:30
Uit dit topic:
Op donderdag 23 mei 2002 10:49 schreef Creepy het volgende:
De sites voor programmeurs:

Website: www.google.com
Soort: Source, Tutorials, Artikelen...ect..ect..
Programmeer Talen: Alles..
Taal: Nederlands, Engels..ect.

Website: www.altavista.com
Soort: Source, Tutorials, Artikelen...ect..ect..
Programmeer Talen: Alles..
Taal: Nederlands, Engels..ect.

etc.

:)

https://fgheysels.github.io/


  • Creepy
  • Registratie: Juni 2001
  • Nu online

Creepy

Tactical Espionage Splatterer

Op maandag 27 mei 2002 08:28 schreef whoami het volgende:
Uit dit topic:
[..]
Oooohh.. ik word gequote :)

#include <curses.h> of een #include <ncurses.h>

En in het geval van Linux is het man commando ook je vriend. (man curses of man ncurses)

"I had a problem, I solved it with regular expressions. Now I have two problems". That's shows a lack of appreciation for regular expressions: "I know have _star_ problems" --Kevlin Henney

Pagina: 1