# Sample a pixel from tk canvas

**URL:** <https://www.ruby-forum.com/t/sample-a-pixel-from-tk-canvas/84616>\
**Category:** Ruby\
**Created:** [February 6, 2007, 1:56pm UTC](https://www.ruby-forum.com/t/sample-a-pixel-from-tk-canvas/84616 "2007-02-06T13:56:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![teeshift](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7cd45c/32.png) [@teeshift](https://www.ruby-forum.com/u/teeshift)\
**Post date:** [February 6, 2007, 1:56pm UTC](https://www.ruby-forum.com/t/sample-a-pixel-from-tk-canvas/84616/1 "2007-02-06T13:56:13Z")

</div>

Is there any method to get a pixel from the canvas? I can draw a pixel  
(painfully by using either  
line or rectangle, same storage anyway) but can I sample a pixel ?

I recall vaguely that Java could probably do it, how about Qt4?  
(haven’t done anything in Qt4  
and haven’t coded Java for years.)

Thank you.

Tee Shift.

---

<div class="post-metadata">

**Author:** ![teeshift](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/7cd45c/32.png) [@teeshift](https://www.ruby-forum.com/u/teeshift)\
**Post date:** [February 6, 2007, 2:00pm UTC](https://www.ruby-forum.com/t/sample-a-pixel-from-tk-canvas/84616/2 "2007-02-06T14:00:14Z")

</div>

sorry, did not do the homework. someone has asked it and the answer  
could be found

[http://groups.google.com/group/comp.lang.ruby/browse\_thread/thread/f0cd7b379e8b195f/e9fded6c453a28bb?lnk=gst&q=get+pixel+canvas&rnum=1#e9fded6c453a28bb](http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/f0cd7b379e8b195f/e9fded6c453a28bb?lnk=gst&q=get+pixel+canvas&rnum=1#e9fded6c453a28bb)
