注册 | 登录

TCL TK canvas Pixelmap

itPublisher 分享于



推荐:innerhtml & tcl/tk IDE

IE、pre、innerHTML Tcl/tk IDE

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 could 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 ?

tcl tk
  this question
edited Jul 16 '13 at 3:28 bluefeet ♦ 155k 39 220 297 asked Aug 2 '11 at 19:30 Roby 736 3 13 33      There are lots of examples of manipulating pixmaps with Tcl here –  glenn jackman Aug 3 '11 at 1:16


1 Answers

You can create a 1x1 filled rectangle on a canvas.

推荐:Tcl/tk 小记

1. 检查variable变量是否声明 在使用Tcl时候会经常遇到no such variable的错误, 往往是由于访问不存在的变量导致的。 使用 info exists来检查variable变量是否

% 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 for info and pointers on scaling photo canvas items.

  this answer
answered Aug 2 '11 at 19:46 evil otto 7,345 8 29      You can scale photo images up, but only by integer factors. See the zoom method. Also note, this is an operation on the master; it changes one data point into many. –  Donal Fellows Aug 3 '11 at 10:17



Tcl       pronounced "tickle", is a fairly simple and           straight forward computer language similar to a           shell language.  Tcl stands








您的注册邮箱: 修改

重新发送激活邮件 进入我的邮箱