Example #1
0
        protected internal override void Draw(RenderTarget renderTarget)
        {
            DrawingStateBlock stateBlock = d2DFactory.CreateDrawingStateBlock();

            renderTarget.SaveDrawingState(stateBlock);
            //AntialiasMode push = RenderTarget.AntialiasMode;
            renderTarget.AntiAliasMode = AntiAliasMode.Aliased;
            renderTarget.FillMesh(mesh, FillBrush);
            //RenderTarget.AntialiasMode = push;
            renderTarget.RestoreDrawingState(stateBlock);
            stateBlock.Dispose();
        }
        public void Dispose()
        {
            this.faceCamera.Stop();

            // Release all resources
            drawingStateBlock.Dispose();
            renderTargetView.Dispose();
            d2dRenderTarget.Dispose();
            backBuffer.Dispose();
            device.ImmediateContext.ClearState();
            device.ImmediateContext.Flush();
            device.Dispose();
            device.Dispose();
            swapChain.Dispose();
            d2dFactory.Dispose();
            dwFactory.Dispose();
            SceneColorBrush.Dispose();
            TextFormat.Dispose();
            drawingStateBlock.Dispose();
            facePointGeometry.Dispose();
            facePointBrush.Dispose();
        }
Example #3
0
        protected internal override void Draw(RenderTarget renderTarget)
        {
            DrawingStateBlock stateBlock = d2DFactory.CreateDrawingStateBlock();

            renderTarget.SaveDrawingState(stateBlock);
            renderTarget.TextRenderingParams = RenderingParams;

            if (Options.HasValue)
            {
                renderTarget.DrawText(Text, TextFormat, layoutRect, FillBrush, Options.Value);
            }
            else
            {
                renderTarget.DrawText(Text, TextFormat, layoutRect, FillBrush);
            }

            renderTarget.RestoreDrawingState(stateBlock);
            stateBlock.Dispose();
        }