views:

109

answers:

1

I want something like a canvas, but where i'd be able to manipulate pixels easily in addition to all the provided geometries, that can be drawn on canvas.

Is it possible to embed something like GD::Image into a canvas? So then I maybe could make the image transparent and set some pixels in it (GD::Image->setPixel()) positioning it over the canvas?

ps: well, that doesn't necessarily have to be perl, as there seem to be bindings for all the libs for most scripting (and not only) languages.

+1  A: 

Tk's canvas isn't designed to provide pixel-level control, but you can do it by putting an image item in and manipulating the pixels in that. I'm not sure about the GD::Image, but I know you can do this with the Tk photo image which supports transparency, and has been transparent by default for quite a long time now.

The other advantage of doing it with images is that they can be restacked within the list of items, hidden, removed, added back in, etc. This gives you a lot of scope for things which would be moderately awkward if you just drew raw.

Donal Fellows
thanksthis still looks like a workaround, not a real solution, but seems like i'll have to accept the answer as the question is not too popular ;)
chhh