Hi everyone, Just came across this simple pixel writing program but have no idea how to use it. Apparently it uses windows GDI (graphical design interface). It would also be very laborious to use having to set colors for 256 points.
use windows GDI
Instead of using SetPixel if you used something like ReadPixel you could read the colors of a full pixel array in a digital photo for instance. Then you could edit that photo. This I presume is C++ programming. There may be a ReadPixel instruction available.
So does anybody know how I can use this program? It somehow involves using windows GDI. From there I could move onto more useful programs of reading all the pixels in a digital photo.
Mod edit: code tags - JohnInTX
C:
#include <windows.h>
int main()
{
HDC hdc = GetDC(GetConsoleWindow());
for (int x = 0; x < 256; ++x)
for (int y = 0; y < 256; ++y)
SetPixel(hdc, x, y, RGB(127, x, y));
}
Instead of using SetPixel if you used something like ReadPixel you could read the colors of a full pixel array in a digital photo for instance. Then you could edit that photo. This I presume is C++ programming. There may be a ReadPixel instruction available.
So does anybody know how I can use this program? It somehow involves using windows GDI. From there I could move onto more useful programs of reading all the pixels in a digital photo.
Mod edit: code tags - JohnInTX
Last edited by a moderator: