I'm probably wrong...
how can i color the text displayed in my program?
i've heard something about
textcolor(RED): for ex. RED
textcolor(4); for ex. RED
setcolor(4); for ex. RED
but they're not working.
is this an extra header-file? i use iostream.h and conio.h
Since you're doing windows console applications,
you probably need to use the console functions in
windows.h. Try the SetConsoleTextAttribute()
function. Here's where you can find information
about it: SetConsoleTextAttribute
Code:
/********************************
The SetConsoleTextAttribute is a function
even though it looks wierd. It kept cutting the
function in half when I posted it as one line.
**********************************/
#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
#include <conio.h>
int main()
{
cout<<"Change Text Color. By me, static.\n";
SetConsoleTextAttribute
(
GetStdHandle(STD_OUTPUT_HANDLE),
FOREGROUND_RED
);
cout<<"This is probably red...\n";
SetConsoleTextAttribute
(
GetStdHandle(STD_OUTPUT_HANDLE),
FOREGROUND_RED | FOREGROUND_BLUE
);
cout<<"This is probably purple...\n";
SetConsoleTextAttribute
(
GetStdHandle(STD_OUTPUT_HANDLE),
FOREGROUND_RED | FOREGROUND_BLUE |
FOREGROUND_INTENSITY
);
cout<<"This is probably a prettier purple...\n";
getch();
return 0;
}
graphics, or better: pictures. i want my program to display pictures. i think they must be in pcx or bmp, am i right? do i have to put them into a 320x240 pixels picture because of the video mode?
You can't display pictures in console apps. (it
says so in the FAQ). There's some code that
displays a bitmap in a DOS app, in the FAQ, but
you need a DOS compiler.
Excuse spelling/Grammar