Tcl/Tkの画像処理を補う拡張を紹介します。
→
package require img_rotate pack [canvas .can -width 100 -height 100] image create photo foo -file tori.gif .can create image 0 0 -image foo -anchor nw # 右に90度回転する ::img_rotate::img_rotate foo R # 左に90度回転する ::img_rotate::img_rotate foo L # 180度回転する ::img_rotate::img_rotate foo U |
← 実際はアニメーションしてます。
package require anigif pack [label .l] # アニメーションGIFのスタート ::anigif::anigif new.gif .l after 2000 # アニメーションGIFのストップ ::anigif::stop .l after 2000 # アニメーションGIFのリスタート ::anigif::restart .l after 3000 # アニメーションGIFの破棄 ::anigif::destroy .l |
どうでしたか? とっても簡単だったでしょ。