diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
commit | d0233291bc8a5068e52c69c210e5979e5324b5bc (patch) | |
tree | 7d9459449c33792c63eeb7baa071e76352e0baab /trunk/ext/tk/sample/tkextlib/blt/winop1.rb | |
parent | 0dc342de848a642ecce8db697b8fecd83a63e117 (diff) | |
parent | 72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff) |
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/ext/tk/sample/tkextlib/blt/winop1.rb')
-rw-r--r-- | trunk/ext/tk/sample/tkextlib/blt/winop1.rb | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/trunk/ext/tk/sample/tkextlib/blt/winop1.rb b/trunk/ext/tk/sample/tkextlib/blt/winop1.rb deleted file mode 100644 index e94138cd94..0000000000 --- a/trunk/ext/tk/sample/tkextlib/blt/winop1.rb +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env ruby -require 'tk' -require 'tkextlib/blt' - -file = File.join(File.dirname(File.expand_path(__FILE__)), - 'images', 'sample.gif') -if File.exist?(file) - src = TkPhotoImage.new(:file=>file) -else - fail RuntimeError, 'no image file' -end - -width = src.width -height = src.height - -TkOption.add('*Label.font', '*helvetica*10*') -TkOption.add('*Label.background', 'white') - -l_img0 = TkLabel.new(:image=>src) -l_hdr0 = TkLabel.new(:text=>"#{width} x #{height}") -l_ftr0 = TkLabel.new(:text=>'100%') -Tk.root.background('white') - -(2..10).each{|i| - iw = width/i - ih = height/i - r = '%6g'%(100.0/i) - dst = TkPhotoImage.new(:width=>iw, :height=>ih) - Tk::BLT::Winop.image_resample(src, dst, :sinc) - l_hdr = TkLabel.new(:text=>"#{iw} x #{ih}") - l_ftr = TkLabel.new(:text=>"#{r}%") - l_img = TkLabel.new(:image=>dst) - Tk::BLT::Table.add(Tk.root, - [0,i], l_hdr, - [1,i], l_img, - [2,i], l_ftr) - Tk.update -} - -Tk.mainloop |