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.
+++ Lastpix'l
|