Search code examples
getpixelsmallbasic

Small Basic - GetPixel() always returns #000000 with Turtle


I have yet to see this question be asked or answerd anywhere, so I thought I should try here. Not being that familier with Small Basic's language logic, i'm trying to just create my own little programs to learn the language better. However, recently I have tried to use the GetPixel() functionality that works well with a regular drawline in the graphics window. But when I draw a line using the Turtle, then try to use GetPixel, it returns #000000 (Black), when it should return #0000FF (Blue).

Does anyone know if GetPixel works when drawing with the Turtle? I thought it would as they share the same space in the graphics window.


Solution

  • As explains in this article http://social.technet.microsoft.com/wiki/contents/articles/29753.small-basic-pixel.aspx the GetPixel() read on the "Drawing" layer. The layers are explains here : http://social.technet.microsoft.com/wiki/contents/articles/15059.small-basic-graphicswindow-basics.aspx.

    Unfortunally the Turtle draw on top off all layers, so the GetPixel() can't read the pixel draw by the turtle.