SaveScreenShot() private static method

private static SaveScreenShot ( int width, int height, Color pixels, string name ) : string
width int
height int
pixels Color
name string
return string
Esempio n. 1
0
        public static string SaveScreenShotWithBorder(Rect r, Color borderColor, string name)
        {
            int num  = (int)r.width;
            int num2 = (int)r.height;

            Color[] array  = InternalEditorUtility.ReadScreenPixel(new Vector2(r.x, r.y), num, num2);
            Color[] array2 = new Color[(num + 2) * (num2 + 2)];
            for (int i = 0; i < num; i++)
            {
                for (int j = 0; j < num2; j++)
                {
                    array2[i + 1 + (num + 2) * (j + 1)] = array[i + num * j];
                }
            }
            for (int k = 0; k < num + 2; k++)
            {
                array2[k] = borderColor;
                array2[k + (num + 2) * (num2 + 1)] = borderColor;
            }
            for (int l = 0; l < num2 + 2; l++)
            {
                array2[l * (num + 2)]             = borderColor;
                array2[l * (num + 2) + (num + 1)] = borderColor;
            }
            return(ScreenShots.SaveScreenShot((int)(r.width + 2f), (int)(r.height + 2f), array2, name));
        }
Esempio n. 2
0
        public static string SaveScreenShotWithBorder(Rect r, Color borderColor, string name)
        {
            int width  = (int)r.width;
            int height = (int)r.height;

            Color[] colorArray = InternalEditorUtility.ReadScreenPixel(new Vector2(r.x, r.y), width, height);
            Color[] pixels     = new Color[(width + 2) * (height + 2)];
            for (int index1 = 0; index1 < width; ++index1)
            {
                for (int index2 = 0; index2 < height; ++index2)
                {
                    pixels[index1 + 1 + (width + 2) * (index2 + 1)] = colorArray[index1 + width * index2];
                }
            }
            for (int index = 0; index < width + 2; ++index)
            {
                pixels[index] = borderColor;
                pixels[index + (width + 2) * (height + 1)] = borderColor;
            }
            for (int index = 0; index < height + 2; ++index)
            {
                pixels[index * (width + 2)] = borderColor;
                pixels[index * (width + 2) + (width + 1)] = borderColor;
            }
            return(ScreenShots.SaveScreenShot((int)((double)r.width + 2.0), (int)((double)r.height + 2.0), pixels, name));
        }
Esempio n. 3
0
        public static void Screenshot()
        {
            GUIView mouseOverView = ScreenShots.GetMouseOverView();

            if (mouseOverView != null)
            {
                string gUIViewName    = ScreenShots.GetGUIViewName(mouseOverView);
                Rect   screenPosition = mouseOverView.screenPosition;
                screenPosition.y      -= 1f;
                screenPosition.height += 2f;
                ScreenShots.SaveScreenShot(screenPosition, gUIViewName);
            }
        }
Esempio n. 4
0
        public static void ScreenshotExtendedRight()
        {
            GUIView mouseOverView = ScreenShots.GetMouseOverView();

            if (mouseOverView != null)
            {
                string     name           = ScreenShots.GetGUIViewName(mouseOverView) + "Extended";
                MainWindow mainWindow     = Resources.FindObjectsOfTypeAll(typeof(MainWindow))[0] as MainWindow;
                Rect       screenPosition = mouseOverView.screenPosition;
                screenPosition.xMax    = mainWindow.window.position.xMax;
                screenPosition.y      -= 1f;
                screenPosition.height += 2f;
                ScreenShots.SaveScreenShot(screenPosition, name);
            }
        }
Esempio n. 5
0
        public static void Screenshot()
        {
            GUIView mouseOverView = ScreenShots.GetMouseOverView();

            if (!((Object)mouseOverView != (Object)null))
            {
                return;
            }
            string guiViewName    = ScreenShots.GetGUIViewName(mouseOverView);
            Rect   screenPosition = mouseOverView.screenPosition;

            --screenPosition.y;
            screenPosition.height += 2f;
            ScreenShots.SaveScreenShot(screenPosition, guiViewName);
        }
Esempio n. 6
0
 public static void SaveScreenShot(Rect r, string name)
 {
     ScreenShots.SaveScreenShot((int)r.width, (int)r.height, InternalEditorUtility.ReadScreenPixel(new Vector2(r.x, r.y), (int)r.width, (int)r.height), name);
 }