sample21.hsp

sample\hspdsp\sample21.hsp » Plain Format

// sample21.hsp 動画上のマウスの座標を取得

#include "hspdsp.as"

// 拡張版 MOUSEマクロ
#define DSP_MOUSEX (ginfo(0)-ginfo(4)-(ginfo(10)-ginfo(12))/2)
#define DSP_MOUSEY (ginfo(1)-ginfo(5)-(ginfo(11)-ginfo(13)-(ginfo(10)-ginfo(12))/2))

 dsp_Init ; 初期化

 title "320,240 座標に 320,240 の大きさで表示"

 dialog "*",16,"メディアファイル"
 if stat=0:end

 // システム標準のレンダラーで開く
 dsp_Open refstr,OPEN_DEFAULT_RENDERER,0,0,0
 //サイズを取得
 x=dsp_info(0):y=dsp_info(1)

 onexit *exit ; 終了時開放するため

 //WM_LBUTTONDOWN を受け取れるように指定
 dsp_SetVideoWindow 12,hwnd
 onclick gosub *Click

 dsp_Play hwnd,320,240,320,240  ; 320,240 座標に 320,240 の大きさで表示

 stop

*exit
 dsp_Stop
 dsp_Close ; メディアファイルを閉じる
 dsp_Exit ; 開放
 end

*Click
 dialog ""+DSP_MOUSEX+"x"+DSP_MOUSEY
 return