command snapshotVideo
export snapshot from rect globalLoc(the topLeft of player "tVideo"), \
globalLoc(the bottomRight of player "tVideo") to file theFolderPath() & "/snap/videoSnap.jpg" as JPEG
-- コマンド「makeMosaic」を書き加える
makeMosaic
end snapshotVideo
command makeMosaic
-- セカンド・ウインドウを開いた時と閉じた時でスタック名を変える
-- openstacks()の中にスタック「LWd」があればスタック名は「LWd」
if "LWd" is among the lines of openstacks() then
put "LWd" into tStackName
else
put "videoStudy" into tStackName
end if
-- モザイクの作成は「02. モザイク」を参照
put the rect of image "tImage" of stack tStackName into tRectImage
put the width of image "tImage" of stack tStackName into tWidth
put the height of image "tImage" of stack tStackName into tHeight
set the rect of image "tImageS" of stack tStackName to tRectImage
set the text of image "tImageS" of stack tStackName to url ("binfile:" & theFolderPath() & "/snap/videoSnap.jpg")
put (the thumbpos of sb "mosaicBar" / 100) into tPercent
set the width of image "tImageS" of stack tStackName to tWidth * tPercent
set the height of image "tImageS" of stack tStackName to tHeight * tPercent
set the width of image "tImage" of stack tStackName to the width of image "tImageS" of stack tStackName
set the height of image "tImage" of stack tStackName to the height of image "tImageS" of stack tStackName
set the imagedata of image "tImage" of stack tStackName to the imagedata of image "tImageS" of stack tStackName
set the rect of image "tImage" of stack tStackName to tRectImage
set the loc of image "tImageS" of stack tStackName to the loc of image "tImage" of stack tStackName
end makeMosaic
プレイビデオ・ボタン、ポウズビデオ・ボタン、ストップビデオ・ボタンのスクリプトは変わりません。
「Open 2nd Window」ボタンに書き込む
on mouseUp
-- スタック"videoStudy" の左右 640
-- スタック "videoStudy" の天地 360
-- 写真の比率 800:450, 1600:900, 16:9
set the hilite of btn "fullScreen" to false
if the hilite of me then
set the height of stack "LWd" to 360
set the width of stack "LWd" to 360 * 16 /9
set the loc of stack "LWd" to item 3 of the rect of stack \
"VideoStudy" + the width of stack "LWd" /2 + 10, item 2 of the loc of stack "VideoStudy"
set the rect of image "tImage" of stack "LWd" to the rect of cd 1 of stack "LWd"
set the text of image "tImage" of stack "LWd" to \
the imageData of image "tImage" of stack "videoStudy"
open stack "LWd"
else
close stack "LWd"
end if
end mouseUp
「Full Screen on 2nd Monitor」ボタンに書き込む
on mouseUp
if the hilite of me is true then
if the hilite of btn "open2nd" is false then
set the hilite of btn "open2nd" to true
end if
-- 2ndディスプレイにフルスクリーンで開く
set the rect of stack "LWd" to line 2 of the screenrects
set the rect of image "tImage" of stack "LWd" to the rect of cd 1 of stack "LWd"
exit to top
else
-- ウインドウ・サイズを小さくする
set the height of stack "LWd" to 360
set the width of stack "LWd" to 360 * 16 /9
set the loc of stack "LWd" to item 3 of the rect of stack "VideoStudy" + the width of stack "LWd" /2 + 10 , \
item 2 of the loc of stack "VideoStudy"
set the rect of image "tImage" of stack "LWd" to the rect of cd 1 of stack "LWd"
end if
end mouseUp