With your help (and SharpDX's) I have created a rectangle and added some text to it. I now want to create a 2px border around the rectangle and I'm not really sure how to go about it.
Here is what I have so far:
protected override void OnRender(ChartControl chartControl, ChartScale chartScale) { //Let's create the rectangle first //implicitly recreate and dispose of brush on each render pass using (SharpDX.Direct2D1.SolidColorBrush dxBrush = new SharpDX.Direct2D1.SolidColorBrush(RenderTarget, SharpDX.Color.DodgerBlue)) { RenderTarget.FillRectangle(new SharpDX.RectangleF((ChartPanel.X + 10), (ChartPanel.Y + 150), (ChartPanel.W - 687), (ChartPanel.H - 180)), dxBrush); } SharpDX.Vector2 startPointTitleBuy = new SharpDX.Vector2(ChartPanel.X + 18, ChartPanel.Y + 155); SharpDX.DirectWrite.TextFormat textFormatTitleBuy = new SharpDX.DirectWrite.TextFormat(Core.Globals.DirectWriteFactory, "Calibiri", SharpDX.DirectWrite.FontWeight.DemiBold, SharpDX.DirectWrite.FontStyle.Normal, 18); SharpDX.RectangleF rectangleFTitleBuy = new SharpDX.RectangleF(startPointTitleBuy.X, startPointTitleBuy.Y, ChartPanel.W, ChartPanel.H); SharpDX.Direct2D1.SolidColorBrush customDXTitleBuyBrush = new SharpDX.Direct2D1.SolidColorBrush(RenderTarget, SharpDX.Color.AliceBlue); RenderTarget.DrawText("My Cool Buy Title", textFormatTitleBuy, rectangleFTitleBuy, customDXTitleBuyBrush); textFormatTitleBuy.Dispose(); customDXTitleBuyBrush.Dispose();
Thanks!
Comment