i'm trying to output an ansi graphic in cosole. But there're two problems. How can i set console borders wider and how can i manipulate with text/background colour? Sorry if i missed smth in search results, i just hurry. Thanks
void CGraphics::posShape(int x1, int y1, int color, char blk)
{
COORD Position;
CONSOLE_CURSOR_INFO info;
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
//if you want to hide the cursor in console add these two lines
info.bVisible = false; //make the cursor invisible
info.dwSize = 1;//length of the cursor
SetConsoleTextAttribute(hOut,color);//sets the color of the printed output
//color range from 0 - 15
Position.X = x1; //set the position of x
Position.Y = y1; //set the position of y
SetConsoleCursorPosition(hOut, Position);
cout<<blk;//outputs a character at position (x1,y1)
}
Hope this helps... be sure to include windows.h library
interesting.. i'll try it, but COORD Position is something like.. cursor position? Sorry for bad english. Well, i don't think this helps me to get a wider console though. I mean that console width by default is 80, and need another number. Is it possible from project? I mean, i can change width in propeties of runnig console, but that's not so right, is it?
P.S.: thanks
and is there a simple way to include a text file to application? I mean, is there a way to make output not from outer file with FILE *f=fopen, but to save data within application?
Pass this command to the console using your prefered method. I would experiment with system() to get the fine tuneing right because it is easy, but swap it out for one of the others later.
You look here under the search box. Type system() click search and it's the first one to pop up. You'll catch some flak for using system() so only use it to prototype.