|
-
May 3rd, 2001, 06:25 AM
#1
Scrolling Help
Hi,
I am a beginner. I am drawing a sound waveform in a CScrollview derived view.
When I use the scroll bars, the drawing moves accordingly but in a persistent manner: All the previous plots stay on screen until their region gets invalidated.
When the whole view is invalidated, the original waveform gets redrawned in the original position relative to the view (device coordinates). It seems not to have noticed the fact that the scrolling bars are not at the same place anymore.
I have tried to use calls to OnPrepareDC and DPtoLP at various places in my code but until now nothing seems to change.
Can anybody give me some hints ?
Thank you very much
-
August 22nd, 2008, 08:22 PM
#2
Re: Scrolling Help
Did you ever fix this? I have the same problem. I'm trying to draw rectangles that seem to draw on themselves again upon scrolling in either direction. Also, the rectangles are completely redrawn when I minimize then restore the window but apparently the origin moves.
My code to draw the rectangles is
CRect TempRect = pDoc->GetNode(i); // The points for the rectangle
OnPrepareDC(pDC);
pDC->DPtoLP(&TempRect);
pDC->Rectangle(TempRect);
and I set the scroll bars sizes in OnInitialUpdate with
CSize Workspace(1000, 1000);
SetScrollSizes(MM_LOENGLISH, Workspace);
I have tried a variety of fixes in OnPrepareDC included setting the mapping mode to MM_LOENGLISH and setting the origin at 0, 0 but nothing works.
Any help?
-
August 22nd, 2008, 09:16 PM
#3
Re: Scrolling Help
You should check out the DrawCLI sample in the MSDN samples.
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
|