Posted to tcl by ro at Wed Jan 02 08:40:16 GMT 2008view raw

  1. load [file join $dir megaimage.dll]
  2. load [file join $dir megaimagetk.dll]
  3.  
  4.  
  5. set size 100
  6. set obj_x 100
  7. set obj_y 50
  8.  
  9. set canvas_width 600
  10. set canvas_height 800
  11.  
  12. set obj [megaimage-blank $canvas_width $canvas_height]
  13. $obj rectangle 0 0 $canvas_width $canvas_height {0 0 0 255}
  14. $obj rectangle $obj_x $obj_y $size $size {255 255 255 255}
  15.  
  16.  
  17.  
  18. set p [image create photo]
  19.  
  20.  
  21. pack [label .p -width $canvas_width -height $canvas_height] \
  22. -fill both -expand 1
  23. .p conf -image $p
  24.  
  25. megaimage.put.on.photo [$obj getdata] $p 0 0 set
  26.  
  27.