108. 関心領域(ROI: Region Of Interest)の切り抜き
void Start () {
int w = Screen.width;
int h = Screen.height;
//画面サイズに対するROIの位置・サイズを設定
int sx = (int)(w * 0.2); //X始点
int sy = (int)(h * 0.3); //y始点
w = (int)(w * 0.6); //横幅
h = (int)(h * 0.4); //縦幅
//キャプチャする領域を保持したRectを作成
capRect = new UnityEngine.Rect(0, 0, w, h);
capTexture =
new Texture2D(w, h, TextureFormat.RGB24, false);
}
capRect = new UnityEngine.Rect(sx, sy, w, h);
始点を変更