Пример #1
0
        private void PlatformConstruct(GraphicsDevice2D graphicsDevice, Texture targetTexture)
        {
            _graphicsDevice = graphicsDevice;

            using (var dxgiSurface = targetTexture.DeviceResource.QueryInterface <Surface>())
            {
                _bitmap = AddDisposable(new Bitmap1(graphicsDevice.DeviceContext, dxgiSurface));
            }
        }
Пример #2
0
        private void PlatformConstruct(GraphicsDevice2D graphicsDevice, string fontFamily, float fontSize, FontWeight fontWeight, TextAlignment alignment)
        {
            DeviceTextFormat = AddDisposable(new DW.TextFormat(
                                                 graphicsDevice.DirectWriteFactory,
                                                 fontFamily,
                                                 ToDirectWriteFontWeight(fontWeight),
                                                 DW.FontStyle.Normal,
                                                 DW.FontStretch.Normal,
                                                 fontSize));

            DeviceTextFormat.TextAlignment = ToDirectWriteTextAlignment(alignment);

            // TODO: Make this configurable.
            DeviceTextFormat.ParagraphAlignment = DW.ParagraphAlignment.Center;
        }
Пример #3
0
 private void PlatformConstruct(GraphicsDevice2D graphicsDevice, Texture targetTexture)
 {
 }
Пример #4
0
 public DrawingContext(GraphicsDevice2D graphicsDevice, Texture targetTexture)
 {
     PlatformConstruct(graphicsDevice, targetTexture);
 }