Drawing an Image over Another



Greetings!
I develop a multiple forms application on Microsoft Visual Studio C++
..NET 2003. In this application, I draw into a picture box using the
Invalidate() method a very "heavy" graphic (composed of lots of
elements).
What I need to do is, on each MouseMove event of the picture box, draw
a rectangle in front of this graphic in backgroud and erase the last
one. (draw a new, erase the old...)
The only way I found to do that is, each time the MouseMove event is
shot, call Invalidate() and redraw ALL the background image again, and
the new rectangle in front of it (the old one is so automatically
erased).
But this is impossible. The redrawing is very, very slow.
Wouldn't there be a way of leaving the backgroud image static and each
time I call Invalidate() just draw the rectangle in front of it?
I thank for any idea.
Marcelo Schio

.



Relevant Pages

  • Re: Owner Draw Button updating
    ... You HAVE to figure out how to invalidate all the buttons. ... >UpdateWindow() the same way. ... Call the Invalidatemethod on each window. ... >draw, and the top left most button flickered constantly. ...
    (microsoft.public.vc.mfc)
  • Re: Invalidating a region and having only that region drawn
    ... > entire screen or a rectangle. ... > When I invalidate a rectangle, YES it appears that only that rectangle is ... In trying to relate this to my situation, I do not explicity draw ... > they are accumulating in the clipping region, but again, I do not actually ...
    (microsoft.public.dotnet.framework.drawing)
  • Flickerproblem on some machines
    ... I want to draw a header in an own view that slowly fades out. ... My current approach is to start some timers that invalidate a rectangle ... void CMyView::OnTimer ...
    (microsoft.public.vc.mfc)
  • Re: CRectTracker: how to remove old rectangle without flick
    ... Use of Invalidate is inevitable. ... image and the clip rectangle at the same time on an offscreen dc and then ... >> It seems that you are not drawing the resize rect within the OnPaint ... >> would have a class for each shape that the user would be able to draw. ...
    (microsoft.public.vc.mfc)
  • Re: Custom ScaleMode setting problem
    ... It sets up a picture box in the way that you require. ... In this way you can draw the finished graph at any physical location and size you require, opaquely or transparently, and you can draw it to the printer in a way that takes full advantage of the printer's high resolution. ... Private pOffsetX As Single, pOffsetY As Single ...
    (microsoft.public.vb.general.discussion)

Loading