Пример #1
0
        protected override void Initialize()
        {
            _deviceSrv = new WpfGraphicsDeviceService(this);
            _mouse     = new WpfMouse(this);
            _keyboard  = new WpfKeyboard(this);

            _sbatch = new SpriteBatch(GraphicsDevice);
            _map    = new MapControl(_sbatch, GraphicsDevice, GraphicsDevice.Viewport.Bounds.ToMapRectangle());

            base.Initialize();

            DisplayInitialized?.Invoke(this);
        }
Пример #2
0
        public void Initialize()
        {
            Size = new Size(CharSize.Width * DisplayWidth, CharSize.Height * DisplayHeight);

            buffer   = new Bitmap(Size.Width, Size.Height);
            renderer = Graphics.FromImage(buffer);
            renderer.SmoothingMode     = System.Drawing.Drawing2D.SmoothingMode.None;
            renderer.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
            renderer.TextRenderingHint = TextRenderingHint.SingleBitPerPixel;

            Clear();

            Invalidate();

            DisplayInitialized?.Invoke(this, EventArgs.Empty);
        }