Пример #1
0
        private Surface(TGraphics graphics, string Filename)
        {
            _graphics = graphics;

            if (!System.IO.File.Exists(Filename))
            {
                throw new System.IO.FileNotFoundException("The file could not be found!", Filename);
            }


            _target = (RenderTarget2D)RenderTarget2D.FromStream(graphics.GraphicsDevice, new FileStream(Filename, FileMode.Open));

            Width  = _target.Width;
            Height = _target.Height;
        }