Re: Animating one object moving in front of another

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On 2007-11-15 16:40:16 -0800, "Peter Webb" <webbfamily@xxxxxxxxxxxxxxxxxxxxxxxxx> said:

[...]
So the solution you have identified doesn't seem to work, as the background is not a constant image - it needs a few pixels added each time to show the update tracks. You don't actually see this new track background until the circle moves and stops obscuring it.

Given your description, I personally would not bother with maintaining a copy of the background at all. Instead, I would just keep a list of the points defining the orbital tracks, and redraw the tracks each time for an update. I know it sounds like a lot of drawing effort, but in reality the time taken to redraw the tracks from scratch will be inconsequential.

That said, nothing about my proposal precludes what you're trying to do. Assuming you've got a background image cached somewhere, there's nothing to stop you from updating it as necessary if and when the background is supposed to change as well. There's no point in that process in which you'd need to clone the existing background though.

[...]
PS I have never even heard of WPF, but what I want to do sounds so simple and common that I think there must be a very simple answer - just being able to copy a Graphics buffer should solve my problem

Copying the background buffer is overkill. Also, IMHO you should be more precise about your terminology. There's not really anything called a "Graphics buffer" in .NET. There's a Graphics object, which is a sort of portal into a buffer (like a Bitmap, Metafile, or even BufferedGraphics), and there's a BufferedGraphics (which you obviously know about). It's not really clear when you write "Graphics buffer" which you're talking about, if either.

Pete

.



Relevant Pages

  • Re: Animating one object moving in front of another
    ... So the solution you have identified doesn't seem to work, as the background is not a constant image - it needs a few pixels added each time to show the update tracks. ... Copying the background buffer is overkill. ... There's not really anything called a "Graphics buffer" in .NET. ... BufferedGraphics myBuffer; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Drawing 2d graphs using Direct3d
    ... >I be using Vertex's to draw the waveforms or is there a better method? ... I would use a circular buffer of vertices to draw this: ... In 3D you redraw the whole scene every time. ...
    (microsoft.public.win32.programmer.directx.managed)
  • [REPOST] java.awt.Image problem
    ... The problem is quite straighforward: ... or added) I redraw the buffer otherwise I only draw the image that's in the ... just recompile my code with the SUN sdk. ...
    (comp.lang.java.programmer)
  • java.awt.Image problem.
    ... The problem is quite straighforward: ... or added) I redraw the buffer otherwise I only draw the image that's in the ... just recompile my code with the SUN sdk. ...
    (comp.lang.java.help)
  • java.awt.Image
    ... The problem is quite straighforward: ... or added) I redraw the buffer otherwise I only draw the image that's in the ... just recompile my code with the SUN sdk. ...
    (comp.lang.java.gui)