Ask your own question, for FREE!
Computer Science 17 Online
OpenStudy (anonymous):

// Returns the column number of a pixel // in an image of size width * height stored as // a one-dimensional array given the index // of the pixel in the one-dimensional array. int get_column(int index, int width, int height) { }

OpenStudy (anonymous):

in c.0 please or C#

OpenStudy (anonymous):

People aren't going to write your code for you. Post what you've tried, and we'll help you to get it running.

OpenStudy (anonymous):

Here's a hint though: Assuming the pixels are stored from left to right then top to bottom, which is normal, then you can calculate the column by dividing the index by the image width and taking the remainder. The command to take the remainder of a division is called a 'modulus' and in C-type languages, it uses the symbol '%'. So for example if it was pixel #14 in an image of 12 pixels width, then calculating 14%12 would give you the result 2.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!