|
-
March 27th, 2005, 06:03 PM
#1
draw chart on a picture control in dialog form?
I have a picture control in a dialog form and I use
CWnd *pWnd = (CWnd*)GetDlgItem(IDC_GRAPH_FRAME);
CDC *pDC = pWnd->GetDC ();
to get pDC and use it draw some lines on the picture. However, it seems the picture control does not update it automatically. So, if I have another window to cover the dialog form, after I move the window, the picture on dialog form will NOT refresh itself. If the project has doc/view, I can use OnDraw(). It is a dialog based form, What I should I?
thanks
-
March 29th, 2005, 05:21 PM
#2
Re: draw chart on a picture control in dialog form?
 Originally Posted by FlyingBear
. . .to get pDC and use it draw some lines on the picture.
Draw where?
 Originally Posted by FlyingBear
However, it seems the picture control does not update it automatically.
Yes it does.
 Originally Posted by FlyingBear
If the project has doc/view, I can use OnDraw(). It is a dialog based form, What I should I?
OnDraw is virtual override that is called from WM_PAINT handler of the CView class.
Many control classes as well as CFormView derived class shortcuts this override since controls provide own drawing (tree or list view for example).
So called picture control is really a static control that has certain styles allowing to display icons, bitmaps or other type of images.
You can use any window to draw in it. Static control is not the best choice (that is why is called static) however painting is not impossible.
You should have your own class and handle WM_PAINT to painting.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|