<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>hello felix,<BR>
<BR>
there are several way's to do this, but the easiest is probably the following:<BR>
<BR>
- use two offscreen canvas objects: 'background' and 'scratch'<BR>
- prepare the background as you already did<BR>
<BR>
then, inside the loop:<BR>
- copy 'background' to 'scratch'<BR>
- draw something on top of scratch<BR>
- wait for vertical retrace (WaitForVerticalBlank)<BR>
- copy scratch to screen<BR><BR><BR>If the background image can be created efficiently (i.e. just a few lines or circles), then it is probalby more efficient to forget the background object and erase and redraw the complete scratch image straight away inside the loop...<BR>
<BR>
best,<BR>
Paul<BR>
<BR>
Paul Groot<BR>
Vrije Universiteit Amsterdam<BR><BR><BR>
<HR id=stopSpelling>
<BR>
> Date: Tue, 23 Jan 2007 11:07:06 +0100<BR>> From: Beamgau@gmx.de<BR>> Subject: canvas as background?<BR>> To: EPRIME@MAIL.TALKBANK.ORG<BR>> <BR>> hi everybody,<BR>> <BR>> i got a canvas, which i want to use as background. there a several coloured circles on it.<BR>> <BR>> now i want to have something like a foreground... i want to draw something on it, clear the foreground, draw and clear in a loop.<BR>> <BR>> the background should not be affected by this "loop". i tried to simply use one canvas for background, one for foreground, but this didn't work out...<BR>> <BR>> can someone tell me how to achieve this? <BR>> <BR>> thanks a lot<BR>> felix fischer<BR>> tu berlin<BR>> -- <BR>> "Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...<BR>> Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail<BR>> <BR><BR><br /><hr />Probeer Live.com: je eigen persoonlijke opstartpagina met alleen de dingen die jij belangrijk vindt op één plek. <a href='http://www.live.com/getstarted' target='_new'>binnen één omgeving.</a></body>
</html>