コード例 #1
0
    public void TakePicture()
    {
        selection = RectTransformUtility.PixelAdjustRect(captureRect, canvas);
        Debug.Log(selection);

        int width  = (int)selection.width;
        int height = (int)selection.height;
        int x      = (int)(canvas.pixelRect.width / 2.0f) + (int)selection.x;
        //int y = (int)(canvas.pixelRect.height / 2.0f - (height / 2.0f) + selection.y);
        int  y    = (int)(canvas.pixelRect.height / 2.0f) + (int)selection.y - 120;
        Rect rect = new Rect(x, y, width, height);

        Debug.Log(rect);
        //snapshot.CaptureAndSaveToAlbum(x, y, width, height, ImageType.PNG);
        snapshot.GetScreenShot(x, y, width, height, ImageType.PNG);
    }
コード例 #2
0
 public Texture2D GetScreenShot(int Width, int Height, Camera cam, ImageType Itype)
 {
     return(snapShot.GetScreenShot(Width, Height, cam, Itype));
 }