Page 1 of 1

Pixel draw VIDEO

Posted: Mon Jun 29, 2009 9:31 pm
by steaky1212
Hi,

I have a 2 dimensional array ( grid[400][400] ), is it possible to draw to the screen a colour dependent on the value in that position....

ie

Code: Select all

for(int x = 0; x<400; x++)
{
   for(int y = 0; y<400 ; y++)
   {
        PIXEL_COLOUR[x][y] = grid[x][y]
    }
}
or something like that?


thanks


--edit--

Oh, and can I get the colour of a pixel already displayed - so if I display a bmp/png/jpeg (whatever) can I get the pixel colour from the coordinate?