Discussion:
How to accelerate view update?
(too old to reply)
yaxixi
2006-04-24 05:10:02 UTC
Permalink
Hi ,
I am developming a lottery software which need to display thousands of
characters. I use OnDraw() function to display all characters once, but it
result in slow reflash. I consider to only display characters of current
client rectange in OnDraw() function, however I can't comfirm the
displayed content when modify the position of scroll bar.
What mathods I can use to make the display smooth? Any help appreciated.
Scott McPhillips [MVP]
2006-04-24 12:41:58 UTC
Permalink
Post by yaxixi
Hi ,
I am developming a lottery software which need to display thousands of
characters. I use OnDraw() function to display all characters once, but it
result in slow reflash. I consider to only display characters of current
client rectange in OnDraw() function, however I can't comfirm the
displayed content when modify the position of scroll bar.
What mathods I can use to make the display smooth? Any help appreciated.
OnDraw can call pDC->GetClipBox to get the minimum rect that needs to be
painted. You may also want to paint into a memory DC and then blit the
DC to the screen DC. This looks very smooth. For an example, see the
DrawCLI MFC sample code in the help.
--
Scott McPhillips [VC++ MVP]
yaxixi
2006-04-24 13:40:02 UTC
Permalink
Thank you for your respond.
I can obtain the rect that needs to be updated, but I don't know the
contents that needs to be painted in this rect. Because the contents will be
modified when change the position of scroll bar. How can I to confirm the
expected contents among all the text contents?
Post by Scott McPhillips [MVP]
Post by yaxixi
Hi ,
I am developming a lottery software which need to display thousands of
characters. I use OnDraw() function to display all characters once, but it
result in slow reflash. I consider to only display characters of current
client rectange in OnDraw() function, however I can't comfirm the
displayed content when modify the position of scroll bar.
What mathods I can use to make the display smooth? Any help appreciated.
OnDraw can call pDC->GetClipBox to get the minimum rect that needs to be
painted. You may also want to paint into a memory DC and then blit the
DC to the screen DC. This looks very smooth. For an example, see the
DrawCLI MFC sample code in the help.
--
Scott McPhillips [VC++ MVP]
Scott McPhillips [MVP]
2006-04-24 14:46:04 UTC
Permalink
Post by yaxixi
Thank you for your respond.
I can obtain the rect that needs to be updated, but I don't know the
contents that needs to be painted in this rect. Because the contents will be
modified when change the position of scroll bar. How can I to confirm the
expected contents among all the text contents?
Assuming that you are using CScrollView, GetScrollPosition will tell you
the scroll position, which you can use to figure out which text needs to
be painted.
--
Scott McPhillips [VC++ MVP]
Loading...