require "GD" zzz = File.open("1.txt"); im = GD::Image.new(2000,2000) M = 30; kol = 0; hite = im.colorAllocate(255,255,255) black = im.colorAllocate(0,0,0) red = im.colorAllocate(255,0,0) blue = im.colorAllocate(0,0,255) while !zzz.eof() do kol = kol+1; s = zzz.readline() a = s.split(); # a.each{|p| p = p.to_f} # puts a[0]*M+" "+a[1]+" "+a[2]+" "+a[3]+"\n"; # im.filledRectangle(0,0,100,100,red); im.rectangle((a[0].to_f*M).to_i,(a[1].to_f*M).to_i,(a[2].to_f*M).to_i,(a[3].to_f*M).to_i,red); # puts x[0]; end puts "Let's write PNG!" f = File.new("ans.png","w"); im.png f f.close;