2012-05-31 3 views
1

간단한 이미지 프로그램을 만들고 있습니다. 나는 PNG 이미지를 처리 ​​할 수있는 chunky_png 보석을 설치,하지만 난 아무 생각이 어떻게 창에 그릴 수 없습니다 필요 :Ruby를 사용하여 이미지를 표시하는 방법은 무엇입니까?

내가 루트 창에서 이미지를 그릴 어떻게해야합니까 무엇
require 'chunky_png' 
require 'tk' 
town = ChunkyPNG::Image.from_file("town.png") 
root = TkRoot.new 
Tk.mainloop 

?

require 'tk' 

$resultsVar = TkVariable.new 
root = TkRoot.new 
root.title = "Window" 

image = TkPhotoImage.new 
image.file = "zara.gif" 

label = TkLabel.new(root) 
label.image = image 
label.place('height' => image.height, 
      'width' => image.width, 
      'x' => 10, 'y' => 10) 
Tk.mainloop 
:

답변

관련 문제