Message: 18
Subject: Re: Using DoubleBufferedCanvas
From: Brad Hutchings <[EMAIL PROTECTED]>
Date: Wed, 15 Feb 2006 09:22:57 -0800
The correct way is for the Canvas to draw itself in its Paint event.
Brad,
Thanks. I'm trying to get my head around this.
The functionality I'm building involves editing music notation with lyrics. So
at various moments I'm drawing lines for music staffs, musical notes,
positioned text with features (bold, etc.), scroll bar etc. In some code, I
need to determine text width as it will appear in the canvas' current font.
Sometimes I draw the whole page. Sometimes I just change the background color
for a small area to indicate highlighted notes. Sometimes I redraw one note and
its surrounding staff lines. Sometimes I need to redraw the entire canvas
because another window is no longer obscuring part of my control, and I don't
what part of the canvas was obscured.
What do I put in the paint event so to achieve that?
I can imagine marking the list of objects I'm displaying with a "Changed"
property so that a monolithic redraw would only modify parts of the backimage before
BLTing it to the canvas. In that scenario, how do I know that Paint wasn't triggered by
another window that was just moved from obscuring the canvas?
-Tom
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>