3
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by Dannyo329
0

It is also possible to do graphics in a console window but I dont know if it what you are looking for. You could easily use BitBlt instead of just LineTo but here is an example:

#define _WIN32_WINNT 0x0500
#include<windows.h>
#include<iostream>
using namespace std;

int main() {
	HWND console = GetConsoleWindow();
	HDC hdc = GetDC(console);
	SelectObject(hdc, CreatePen(0, 30, RGB(255,255,255)));
	POINT p;
	GetCursorPos(&p);
	ScreenToClient(console, &p);
	MoveToEx(hdc, p.x, p.y, NULL);
	for (;;) {
		GetCursorPos(&p);
		ScreenToClient(console, &p);
		LineTo(hdc, p.x, p.y);
		Sleep(1);
	}
	ReleaseDC(console, hdc);
	cin.ignore();
	return 0;
}
0

I'm using win32, and I'm just trying to put any image on, with words as well.
Just like a babyish picutre book.......

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.