[Tk] TkPhotoImage question

  • Thread starter email55555 email55555
  • Start date
E

email55555 email55555

It seems to me that the usage of TkPhotoImage is not like others Ruby/Tk ...

a.copy(b, :subsample=>5) # is OK. a, b are instance of TkPhotoImage

but if you want subsample x y :
a.copy(b, :subsample=>'5 5') # ==> Error ...
a.copy(b, :subsample=>[5, 5]) # ==> Error ...

I found the only way is :
a.copy(b, '-subsample 5 5') # OK

Same problem on read, write ... etc

a.read('image.gif', :shrink) #==> Error
a.read('image.gif', 'shrink') #==> Error

The only way to do it is :
a.read('image.gif', '-shrink')

Is there some reasons to desing TkPhotoImage this way ?

Thank you.
 
H

Hidetoshi NAGAI

Hi,

From: email55555 email55555 <[email protected]>
Subject: [Tk] TkPhotoImage question
Date: Sun, 26 Dec 2004 13:32:23 +0900
Message-ID: said:
but if you want subsample x y :
a.copy(b, :subsample=>'5 5') # ==> Error ...
a.copy(b, :subsample=>[5, 5]) # ==> Error ...

":subsample=>'5 5'" cannot be acceptable, because each value
of the argument must be one token on the Tcl/Tk command.
But ":subsample=>[5, 5]" is acceptable on Ruby1.8.2 release.
Same problem on read, write ... etc
a.read('image.gif', :shrink) #==> Error
a.read('image.gif', 'shrink') #==> Error
The only way to do it is :
a.read('image.gif', '-shrink')

If you want set options without value on Tcl/Tk, please give true
for each of the options (e.g. a.read('image.gif', :shrink=>true.))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top