'GWの自由研究 画像ビューワ クリックでファイル選択、選択キャンセルで終了
sw = screen width
sh = screen height
ww = 640 : wh = 480
resize console (sw-ww)/2,(sh-wh)/2,(sw+ww)/2,(sh+wh)/2
main:
'オープンダイアログ
target$ = open dialog$
if target$="" then end
'リサイズ
get quicktime pict size target$,pw,ph
rsd = ww/pw
if rsd>(wh/ph) then rsd=wh/ph
rw=pw*rsd
rh=ph*rsd
'バックグラウンドに等倍で画像ロード
kill screen loader
loader = init screen(0,0,pw,ph)
set screen to loader : cls
load quicktime pict target$
if movies error then end
'リサイズしてコンソールに転送
set screen to console : cls
copyrect 0,0,pw,ph,(ww-rw)/2,(wh-rh)/2,(ww+rw)/2,(wh+rh)/2,0,loader,0
'入力待ち
repeat
system time 5
until button
goto main