Пример #1
0
        private async Task <ManagedSurface> LoadFromUriAsyncWorker(Uri uri, Size size, LoadTimeEffectHandler handler)
        {
            ManagedSurface surface = new ManagedSurface(CreateSurface(size));
            await surface.Draw(_graphicsDevice, _drawingLock, new BitmapDrawer(uri, handler));

            return(surface);
        }
Пример #2
0
        public ManagedSurface LoadText(string text, Size size, CanvasTextFormat textFormat, Color textColor, Color bgColor)
        {
            ManagedSurface surface = new ManagedSurface(CreateSurface(size));
            var            ignored = surface.Draw(_graphicsDevice, _drawingLock, new TextDrawer(text, textFormat, textColor, bgColor));

            return(surface);
        }
Пример #3
0
        public ManagedSurface LoadFromUri(Uri uri, Size size, LoadTimeEffectHandler handler)
        {
            ManagedSurface surface = new ManagedSurface(CreateSurface(size));
            var            ignored = surface.Draw(_graphicsDevice, _drawingLock, new BitmapDrawer(uri, handler));

            return(surface);
        }
Пример #4
0
        public ManagedSurface LoadCircle(float radius, Color color)
        {
            ManagedSurface surface = new ManagedSurface(CreateSurface(new Size(radius * 2, radius * 2)));
            var            ignored = surface.Draw(_graphicsDevice, _drawingLock, new CircleDrawer(radius, color));

            return(surface);
        }
Пример #5
0
 public void UnregisterSurface(ManagedSurface surface)
 {
     _deviceReplacedEvent -= surface.OnDeviceReplaced;
 }