ahh~<br><br>it goes horizontally first<br><br>why didn't I think of that?<br><br>thank you ~<br><br><div><span class="gmail_quote">On 7/19/07, <b class="gmail_sendername">Tiger12506</b> <<a href="mailto:keridee@jayco.net">
keridee@jayco.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">You know the height and the width of the image, no?<br>
<br>So you know that every 'width' number of pixels will start a new row.<br>So if you wanted say the fifth row down, second pixel, how would you find<br>it?<br><br>The 1st line: 'width' number of pixels<br>
The 2nd line: 'width' number of pixels<br>The 3rd line: 'width number of pixels<br>The 4th line: 'width' number of pixels<br>The 5th line: 2 pixels in from the left<br><br>Add those up ~ width+width+width+width+2
<br>Or 4*width+2<br><br>That number is the index to use to get the pixel at coords (2,5)<br>so<br><br>pixel = getdata()<br>pixel[4*width+2]<br><br>For this example.<br>Work out a more general solution for yourself please.
<br><br>JS<br><br>> getdata() returns a flattened list, [n]<br>><br>><br>> but i am not sure how to access it.<br>><br>> when I want to get rgb from a window of 100,200,<br>><br>> get data starts from 0 (0~99, 0~199)
<br>><br>> the point of x,y = 2, 1<br>><br>> do I put in<br>><br>> pixel[100] ?<br>><br>><br>> it's actually not the case @_@<br>><br>> what should I put in ?<br><br>_______________________________________________
<br>Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br>