$event:=FORM Event:C1606

Case of 
	: ($event.code=On Selection Change:K2:29)
		If (Form:C1466.selectedPicture#Null:C1517)  //ピクチャーが選択されていれば
			
			$picturesize:=600
			PICTURE PROPERTIES:C457(Form:C1466.selectedPicture.Thumbnail; $width; $height)
			
			OBJECT GET COORDINATES:C663(*; "thumbnail1"; $l; $t; $r; $b)
			OBJECT SET COORDINATES:C1248(*; "thumbnail1"; $l; $t; $l+$width; $t+$height)
			OBJECT SET SCROLL POSITION:C906(*; "Input"; 0; 0)
			
			OBJECT SET VISIBLE:C603(*; "Rectangle"; True:C214)
			
			PICTURE PROPERTIES:C457(Form:C1466.selectedPicture.Picture; $width; $height)
			If ($width<$picturesize) | ($height<$picturesize)  //ピクチャーのサイズがピクチャーエリアのサイズより小さい
				OBJECT SET COORDINATES:C1248(*; "Rectangle"; Form:C1466.thumbnailLeft; Form:C1466.thumbnailTop; Form:C1466.thumbnailLeft+$thumwidth; Form:C1466.thumbnailTop+$thumheight)
			Else   //ピクチャーのサイズがピクチャーエリアより幅か高さが大きい
				$rate1:=$picturesize/$height
				$rate2:=$picturesize/$width
				OBJECT GET COORDINATES:C663(*; "thumbnail1"; $l; $t; $r; $b)
				OBJECT SET COORDINATES:C1248(*; "Rectangle"; Form:C1466.thumbnailLeft; Form:C1466.thumbnailTop; Form:C1466.thumbnailLeft+(($r-$l)*$rate2); Form:C1466.thumbnailTop+(($b-$t)*$rate1))
			End if 
		Else   //ピクチャーが選択されていなければ
			OBJECT SET VISIBLE:C603(*; "Rectangle"; False:C215)
			OBJECT SET COORDINATES:C1248(*; "thumbnail1"; Form:C1466.thumbnailLeft; Form:C1466.thumbnailTop; Form:C1466.thumbnailRight; Form:C1466.thumbnailBottom)
		End if 
		
End case 