Ejemplo n.º 1
0
        static GraphicsContext()
        {
            int result;

            PsmGraphicsContext.GetScreenSizes(null, out result);
            GraphicsContext.screenSizes = new ImageSize[result];
            PsmGraphicsContext.GetScreenSizes(GraphicsContext.screenSizes, out result);
            int screenWidth;
            int screenHeight;

            PsmGraphicsContext.GetMaxScreenSize(out screenWidth, out screenHeight);
            for (int i = 0; i < result; i++)
            {
                if (GraphicsContext.screenSizes[i].Width > screenWidth || GraphicsContext.screenSizes[i].Height > screenHeight)
                {
                    ScreenBuffer.FitRect(screenWidth, screenHeight, ref GraphicsContext.screenSizes[i].Width, ref GraphicsContext.screenSizes[i].Height);
                }
            }
        }
Ejemplo n.º 2
0
        public static bool NeedVirtualScreen(FrameBuffer screen, ref int width, ref int height)
        {
            if (width == 0)
            {
                width = screen.Width;
            }
            if (height == 0)
            {
                height = screen.Height;
            }
            int screenWidth;
            int screenHeight;

            PsmGraphicsContext.GetMaxScreenSize(out screenWidth, out screenHeight);
            if (width > screenWidth || height > screenHeight)
            {
                ScreenBuffer.FitRect(screenWidth, screenHeight, ref width, ref height);
            }
            return(screen.Width != width || screen.Height != height);
        }