//%attributes = {}
//画像サイズに応じて表示範囲の赤ボックスのサイズ変更

$picturesize:=600
PICTURE PROPERTIES:C457(Form:C1466.selectedPicture.Picture; $width; $height)

OBJECT GET COORDINATES:C663(*; "Rectangle"; $l; $t; $r; $b)
$rectanglesize:=New object:C1471("width"; ($r-$l); "height"; ($b-$t))
OBJECT GET COORDINATES:C663(*; "thumbnail1"; $l; $t; $r; $b)
$thumbnailsize:=New object:C1471("width"; ($r-$l); "height"; ($b-$t))


If ($width<$picturesize) | ($height<$picturesize)  //ピクチャーの幅か高さがエリアの高さが小さい
	$rectanglesize.width:=80
	$rectanglesize.height:=80
Else   //ピクチャーの幅も高さもエリアより大きい
	$rectanglesize.width:=($picturesize/$width)*$thumbnailsize.width
	$rectanglesize.height:=($picturesize/$height)*$thumbnailsize.height
End if 

OBJECT SET COORDINATES:C1248(*; "Rectangle"; Form:C1466.thumbnailLeft; Form:C1466.thumbnailTop; $l+$rectanglesize.width; $t+$rectanglesize.height)

