At 1:31 PM -0400 8/26/04, GAmoore at aol dot com wrote:
I have tried to implement this, but as simple as it is, there is something
not right. Something that use to take 0.5 seconds now takes as long as 20
seconds.
You'll have to use a profiler or step through your code -- clearly
it's doing a lot more work than you think it is.
Two attempts ...
======================================================================
sub draw_canvas( g as graphics )
draw_layer1 g
draw_layer2 g
draw_layer3 g
draw_layer4 g
This code is right. You should be calling this from the Paint event
of your canvas (and pass in 'g'), as well as anyplace else you need
to update the display (and pass in canvas3.graphics or whatever).
======================================================================
sub draw_canvas( g as graphics )
Dim g2 as Graphics = window3.canvas3.graphics
draw_layer1 g2
draw_layer2 g2
draw_layer3 g2
draw_layer4 g2
g = g2
This code is not right; it ignores the place the caller is telling it
to draw (drawing into canvas3.graphics of the implicit instance of
window3 instead!), and then at the end, does a pointless reassignment
of the parameter (which is really just a local variable).
Best,
- Joe
--
,------------------------------------------------------------------.
| Joseph J. Strout REAL Software, Inc. |
| joe at realsoftware dot com http://www.realsoftware.com |
`------------------------------------------------------------------'
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>
|