Help for setPixel

I thought I followed the directions of the RME, but my output is not matching the output provided as a sample.

HEADER

/**
* Requires: color is a valid Color
* Modifies: pixelData.
* Effects: Sets the pixel at (x, y) to color
* if it is within the bounds.
* See the specification for how pixels are stored.
*/
void setPixel(int x, int y, Color color);

CPP

void Graphics::setPixel(int x, int y, Color color) {
pixelData[x][y] = color;


Not sure what an RME is but a guess is that maybe you have x and y in the wrong order.
Topic archived. No new replies allowed.