TCL TK canvas Pixelmap
I need to generate a pixelmap. I know the height and the width. But now I need to fill one pixel ( or a block for bigger resolution ) on the position x y. What is the easiest way to do it?
It should not be just one pixel, because its cou开发者_如何学Cld be to small to view it. so it would be really good if i could say, my canvas has to height 1024 and with of 768 and the pixelmap just only have 500 x 500 "pixel" so that every point is a little bit bigger.
Could someone help me a little bit ?
You can create a 1x1 filled rectangle on a canvas.
% canvas .c
% pack .c
% .c create rectangle 5.0 5.0 6.0 6.0 -outline "" -fill black
Not really a pixmap, but it is scalable. Alternately, you could use bitmap
or photo
canvas items, which have ways to manipulate them at the pixel level, but can't be scaled as easily. See http://wiki.tcl.tk/8448 for info and pointers on scaling photo
canvas items.
精彩评论