sebeuste
Messages postés19Date d'inscriptionvendredi 16 mai 2003StatutMembreDernière intervention 5 avril 2005
-
26 févr. 2004 à 17:47
lastpixl
Messages postés56Date d'inscriptionsamedi 28 juin 2003StatutMembreDernière intervention16 février 2006
-
2 mars 2004 à 09:54
Je voudrais reussir a definir chaque pixel de l'ecran de la console mais je ne sais pas quelle bibliothèque utilisée et quelle fonction non plus .... Je ne suis pas très avancé en C++ ... bien, si quelqu'un peut m'aider ?
Sbeu!!!
lastpixl
Messages postés56Date d'inscriptionsamedi 28 juin 2003StatutMembreDernière intervention16 février 2006 2 mars 2004 à 09:54
COLORREF SetPixel(
HDC hdc, // handle to DC
int X, // x-coordinate of pixel
int Y, // y-coordinate of pixel
COLORREF crColor // pixel color
);
Header: Declared in Wingdi.h; include Windows.h.
Library: Use Gdi32.lib.
(de msdn).
Pour S'en servir, il faut un hDc, récupérable avec
HDC GetDC(
HWND hWnd // handle to window
);
Parameters
hWnd
[in] Handle to the window whose DC is to be retrieved. If this value is NULL, GetDC retrieves the DC for the entire screen.
Windows 98/Me, Windows 2000/XP: To get the DC for a specific display monitor, use the EnumDisplayMonitors and CreateDC functions.
.
#include <windows.h>
---Création de la fenêtre etc---
HDC hDc;
hDc = GetDC(hWnd);
SetPixel(hDc, 1, 1, (COLORREF) RGB(255,255,255)); //Pour afficher un pixel noir
Fait sans compilateur mais ca devrait marcher... Le cast n'est peut-être pas utile.