API version 34
iOSAndroidWindows
|
説明 |
プレビュー中にカメラのズーム倍率を指定します。 CameraCaptureViewで指定可能なズーム倍率の範囲外の値が指定された場合、ズーム倍率は指定可能な最大倍率、あるいは最小倍率が適用されます。
|
|
|
呼出形式 |
captureView.SetZoomRatio( scale )
|
|
|
戻り値 |
なし
|
|
|
引数 |
Number scale |
ズーム倍率
|
|
例外 |
EXT-27 |
初期化が完了していません |
|
|
EXT-46 |
カメラの操作に失敗しました
|
|
使用例 |
CameraCaptureView captureView {
X = 10;
Y = 10;
Width = 200;
Height = 300;
}
Button btnStartCamera {
X = 10;
Y = 320;
Width = 100;
Height = 40;
Title = "カメラ開始";
Function OnTouch( e ) {
try {
/* ズームバーを表示します */
var extraParams = new Array;
extraParams["SHOW_ZOOMBAR"] = true;
/* カメラ表示 */
^.captureView.ShowCamera(Runtime.SourceTypeRearCamera, extraParams);
} catch (e) {
//.MessageBox(e.Method + "-" + str(e.Code));
//.MessageBox(e.message);
}
}
}
Button btnStopScan{
X = 120;
Y = 320;
Width = 100;
Height = 40;
Title = "カメラ停止";
Function OnTouch( e ) {
try {
/* カメラ停止 */
^.captureView.HideCamera();
} catch (e) {
//.MessageBox(e.Method + "-" + str(e.Code));
//.MessageBox(e.message);
}
}
}
Button btnZoom{
X = 120;
Y = 370;
Width = 100;
Height = 40;
Title = "ズーム倍率3倍";
Function OnTouch( e ) {
try {
/* ズーム倍率設定 */
^.captureView.SetZoomRatio(3.0);
} catch (e) {
//.MessageBox(e.Method + "-" + str(e.Code));
//.MessageBox(e.message);
}
}
}
Button btnCapture{
X = 120;
Y = 420;
Width = 100;
Height = 40;
Title = "撮影";
Function OnTouch( e ) {
try {
/* 撮影 */
var img = ^.captureView.Capture();
^.imgView.SetImage(img);
} catch (e) {
//.MessageBox(e.Method + "-" + str(e.Code));
//.MessageBox(e.message);
}
}
}
ImageLabel imgView {
X = 220;
Y = 10;
Width = 200;
Height = 200;
ImageWidth = 200;
ImageHeight = 200;
Resize = $KEEPRATIO;
}
|
|
|
関連項目 |
||