private void PlatformConstruct(GraphicsDevice2D graphicsDevice, Texture targetTexture) { _graphicsDevice = graphicsDevice; using (var dxgiSurface = targetTexture.DeviceResource.QueryInterface <Surface>()) { _bitmap = AddDisposable(new Bitmap1(graphicsDevice.DeviceContext, dxgiSurface)); } }
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) { }
public DrawingContext(GraphicsDevice2D graphicsDevice, Texture targetTexture) { PlatformConstruct(graphicsDevice, targetTexture); }