require 'phi'
include Phi
mf = Metafile.new
mf.width = 200
mf.height = 100
mc = MetafileCanvas.new(mf, 0)
require 'weakref'
mc = WeakRef.new(mc)
mc.font
mc.text_out(0, 0, 'Apolloでグラフィックス')
#mc = nil
#p mc
#GC.start
ObjectSpace.garbage_collect
#p mc

mf.save('Test.emf')

form = Phi::Form.new
image = Phi::Image.new form
image.align = AL_CLIENT
mf2 = Phi::Metafile.new
mf2.load('Test.emf')
image.picture.metafile = mf2
image.stretch = true
form.show
mainloop
