示例#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;
        }
 private void PlatformConstruct(GraphicsDevice2D graphicsDevice, Texture targetTexture)
 {
 }
示例#4
0
 public DrawingContext(GraphicsDevice2D graphicsDevice, Texture targetTexture)
 {
     PlatformConstruct(graphicsDevice, targetTexture);
 }