Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Is it possible to marshal DrawingContext to native code

$
0
0

I have some custom control with some trivial OnRender method:

        protected override void OnRender(DrawingContext dc)
        {
            base.OnRender(dc);

            SolidColorBrush mySolidColorBrush = new SolidColorBrush();
            
            mySolidColorBrush.Color = Colors.SandyBrown;
            
            Pen myPen = new Pen(Brushes.Blue, 6);

            Rect myRect = new Rect(0, 0, _extent.Width, _extent.Height);
            
            dc.DrawRectangle(mySolidColorBrush, myPen, myRect);
                        
            //drawingContext.DrawText(m_formattedText, m_textPos);
        }
is it right that DrawingContext has underlying Direct2D ID2D1DeviceContext and ID2D1RenderTarget? If so, is it possible to pass pointers to this interfaces from my OnRender to native code written in pure C++ without CLI and do some drawing with them?

Dmitriano http://developernote.com


Viewing all articles
Browse latest Browse all 18858

Trending Articles