wansch
12/5/2004 4:21:00 PM
Hi,
flickering is no problem, the problem is that I invalidate a region and all
primitives in this region are then redrawn. So it looks like the more
primitives the selection frame contains the redrawn takes longer. When I look
at other applications like MS-Excel such a frame opened over hundreds of
objects takes quite small amount of cpu time, if the number of objects in the
frame increases the amount of cpu time doesn't seem to rise. In my region
invalidation scenario I need about 60-80 percent cpu time wich increases fast
when the frame contains more objects (primitives).
So my question must be:
Is there another technique to draw the frame as with invalidating a region?
"Samuel Caparros" wrote:
> Well, I'm absolutely no expert, I've been struggling with GDI+ for a
> fairly short time, but I think there's some approaches you might want
> to check. The first of them is probably automatic double-buffering.
> Check Bob Powell's site for that. If flickering is not a problem and
> only performance is, try Invalidating only the necessary part of the
> "canvas"...a very simple way to accomplish this would be the
> following.
>
> Dim r As New Rectangle (primitive.X-10, primitive.Y-10,
> primitive.Width+20, primitive.Height+20)
> Me.Invalidate (r)
>
> But probably someone else will have a better answer in no time :)
>
>
> wansch <wansch@discussions.microsoft.com> wrote in message news:<491485D2-C829-4AF2-83DE-1864D38C53B6@microsoft.com>...
> > Hello,
> >
> > I try to create a retained mode graphics system where you can select
> > primitives and drag them around. So I created a selection frame from a
> > rectangel which I draw when the left mouse button is down and moving. When I
> > move over the canvas surface with the mouse always the hole rectangle region
> > of the selection frame is invalidated. That doesn't seem to be very
> > performant , all primitives in the region are redrawn.
> > My question:
> > What is the right concept for drawing a selection frame?
>