GDI drawing in picture control

Hello there

I have an MFC-application where I've put a picture control in the form-dialog. I am drawing a graph in it and everything works fine except that the drawing goes outside of the control. It literally paints the whole form. In my understandig, this shouldn't be the case.
Type of the control is Bitmap, but ownerdrawn etc. provide the same results.

OnPaint code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
void CGraph::OnPaint ()
{
	CPaintDC dc(this);
	dc.SetViewportOrg (0, 400);
	dc.SetMapMode(MM_ISOTROPIC);
	dc.SetWindowExt(1000, 800);
	dc.SetViewportExt(1000, -800);

	// MessageBox(L"OnPaint");
	ProcessData ();
	DrawCoordinateSystem (&dc);
	DrawGrid (&dc);
	DrawGraph (&dc);
}


Thanks for your help
Can nobody give me a hint? I thougt it was probably a pretty basic problem.
Well, MFC is pretty ancient/outdated. There're much better GUI API's out there.

As far as I know a 'bitmap control' doesn't exist in MFC. It's likely that the paint event refers to the form.

This is an explanation for custom controls with MFC

http://www.codeproject.com/Articles/521/Creating-Custom-Controls

it's of course pretty old
Topic archived. No new replies allowed.