How can i get the color of a pixel... For example (x=100,y=100,color=1 "random") // color is random !!!!
and I want to get the color of this pixel.... and if the color=1 bla bla.... and so on... I need this for my game.. please help me...
How can i get the color of a pixel... For example (x=100,y=100,color=1 "random") // color is random !!!!
and I want to get the color of this pixel.... and if the color=1 bla bla.... and so on... I need this for my game.. please help me...
What OS? What compiler?
"There's always another way"
-lightatdawn (lightatdawn.cprogramming.com)
Hell, what are you useing to draw the pixel in the first place?
Let me assume for a second that you are using dos mode 13h. If you want to get a pixel then do something like:
Code://screen_buffer will be the buffer where I could find pixels //SCREE_WIDTH will be the horizonal resolution of the screen. unsigned char pixelAt(int x, int y){ return screen_buffer[y*SCREEN_WIDTH + x]; }
I hav eBOrland 5.02 and I'm programing in 13h... Thakx for the replys ... But If I got the pixel how can I get the COLOR of this pixel.????? thanx in advance...............