Bounty Collector
Bounty Collector

Reputation: 635

How do i draw something in a child window. in MFC?

I want to draw the skeleton of hand in MFC, I get the hand and finger coordinates data from my camera and I want it to show on screen in a child window using MFC (i know how to do this in OpenGL, but no idea about MFC)

Can someone guide me with it?

Upvotes: 0

Views: 407

Answers (1)

ScottMcP-MVP
ScottMcP-MVP

Reputation: 10415

Derive a class from the type of child window you want, such as CStatic or CDialog. Add a message handler for WM_PAINT. Your OnPaint message handler must start like this:

void CGraph::OnPaint()
{   CPaintDC dc(this);
    // Use dc.FillSolidRect() and other DC functions to draw
}

If you have an array of points you wish to draw dc.Polyline(...) will connect the points.

Upvotes: 1

Related Questions