Form ImgSd_001 {
Width = 310;
Height = 464;
Runtime r;
ImageLabel ImageLabel1 {
X = 4;
Y = 151;
Width = 301;
Height = 138;
HorizontalAlign = $CENTER;
Border = $TRUE;
BorderStyle = $PLANE;
}
Label Label1 {
X = 62;
Y = 296;
Width = 241;
Height = 30;
BgColor = $FFFFCC;
VerticalAlign = $CENTER;
HorizontalAlign = $CENTER;
FontFace = $BOLD;
}
Label Label2 {
X = 9;
Y = 296;
Width = 52;
Height = 30;
BgColor = $FFFFCC;
Value = "輝度:";
HorizontalAlign = $CENTER;
VerticalAlign = $CENTER;
FontFace = $BOLD;
}
Button Button1 {
X = 8;
Y = 331;
Width = 296;
Height = 37;
Title = "カメラ起動";
HorizontalAlign = $CENTER;
FontFace = $BOLD;
Function OnTouch( e ) {
/* カメラキャプチャ開始 */
ImgSd_001.r.StartCameraCapture();
/* メッセージ出力 */
//.MessageBox("カメラ起動しました");
ImgSd_001.Button2.Active = $TRUE;
this.Active = $FALSE;
}
}
Button Button2 {
X = 8;
Y = 374;
Width = 296;
Height = 37;
Title = "カメラ撮影";
HorizontalAlign = $CENTER;
Active = $FALSE;
FontFace = $BOLD;
Function OnTouch( e ) {
/* カメラから画像をキャプチャ(戻り値はImageクラス) */
var res = ImgSd_001.r.GetCameraCaptureImage();
/* 画像を画面に表示 */
ImgSd_001.ImageLabel1.SetImage(res);
/* 輝度情報を取得する */
var lum_wk = res.GetInformation( Image.Info_Luminance );
/* 輝度情報を画面に表示する */
ImgSd_001.Label1.Value = lum_wk;
ImgSd_001.Button3.Active = $TRUE;
}
}
Button Button3 {
X = 8;
Y = 417;
Width = 296;
Height = 37;
Title = "カメラ停止";
HorizontalAlign = $CENTER;
Active = $FALSE;
FontFace = $BOLD;
Function OnTouch( e ) {
/* カメラキャプチャ停止 */
/* 終了時、StartCameraCaptureメソッドを実行してください */
ImgSd_001.r.StopCameraCapture();
/* メッセージ出力 */
//.MessageBox("カメラ停止しました");
/* 画面初期化 */
ImgSd_001.Label1.Clear();
ImgSd_001.ImageLabel1.ResetImage();
ImgSd_001.Button1.Active = $TRUE;
ImgSd_001.Button2.Active = $FALSE;
this.Active = $FALSE;
}
}
}
|