Method: TkPhotoImage#read

Defined in:
lib/tk/image.rb

#read(file, *opts) ⇒ Object



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/tk/image.rb', line 342

def read(file, *opts)
  if opts.size == 0
    tk_send('read', file)
  elsif opts.size == 1 && opts[0].kind_of?(Hash)
    tk_send('read', file, *_photo_hash_kv(opts[0]))
  else
    # for backward compatibility
    args = opts.collect{|term|
      if term.kind_of?(String) && term.include?(?\s)
        term.split
      else
        term
      end
    }.flatten
    tk_send('read', file, *args)
  end
  self
end