How to make a rectangular shape that self-adjusts to the WPF screen in Visual Studio C #?

0

I am trying to make a rectangle that is self-adjusting to the WPF screen and also that it can change color when it is traversed by a hand of the Kinect body tracking program, but at the moment I do not get either of those things, someone can you give me a hand please? On the internet there is no example of really what I would like to achieve or at least I have not found it. A greeting I think the part of the code to implement would go here:

if (dataReceived)
{
        using (DrawingContext dc = this.drawingGroup.Open())
        {

            // Draw a transparent background to set the render size: Se trata de realizar un fondo , en este caso negro
            dc.DrawRectangle(Brushes.Black, null, new Rect(0.0, 0.0, this.displayWidth, this.displayHeight));

            int penIndex = 0;
            foreach (Body body in this.bodies)
            {
                Pen drawPen = this.bodyColors[penIndex++];

            }
        }
}          
    
asked by Daniel Potrimba 23.05.2017 в 10:31
source

0 answers