ahh~<br><br>it goes horizontally first<br><br>why didn&#39;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> &lt;<a href="mailto:keridee@jayco.net">
keridee@jayco.net</a>&gt; 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 &#39;width&#39; 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:&nbsp;&nbsp;&#39;width&#39; number of pixels<br>
The 2nd line: &#39;width&#39; number of pixels<br>The 3rd line: &#39;width number of pixels<br>The 4th line: &#39;width&#39; number of pixels<br>The 5th line: 2 pixels in from the left<br><br>Add those up ~&nbsp;&nbsp;width+width+width+width+2
<br>Or&nbsp;&nbsp;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>&gt; getdata() returns a flattened list, [n]<br>&gt;<br>&gt;<br>&gt; but i am not sure how to access it.<br>&gt;<br>&gt; when I want to get rgb from a window of 100,200,<br>&gt;<br>&gt; get data starts from 0&nbsp;&nbsp;&nbsp;&nbsp;(0~99, 0~199)
<br>&gt;<br>&gt; the point of&nbsp;&nbsp;x,y = 2, 1<br>&gt;<br>&gt; do I put in<br>&gt;<br>&gt; pixel[100]&nbsp;&nbsp; ?<br>&gt;<br>&gt;<br>&gt; it&#39;s actually not the case&nbsp;&nbsp;@_@<br>&gt;<br>&gt; what should I put in ?<br><br>_______________________________________________
<br>Tutor maillist&nbsp;&nbsp;-&nbsp;&nbsp;<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>