Re: RE: [wxpython-users] What's going on with wx.Pen()?
by Tim Roberts other posts by this author
May 8 2008 6:05PM messages near this date
RE: [wxpython-users] What's going on with wx.Pen()?
|
RE: [wxpython-users] What's going on with wx.Pen()?
Marlin Rowley wrote:
> When you say "rubber-banding" what do you mean?
The kind of thing you are drawing with your red rectangle is called
"rubber banding", because it looks something like stretching a rubber
band (or elastic band) over the desktop image.
> If I take the XOR away, I get the rectangle redrawing over itself
> continuously as I draw out a rectangle.
Right. However, if you check out applications like Photoshop and GIMP,
you'll see that their rubber bands DO vary in color based on the
background. For example, consider what will happen with your red
rectangle if you try to drag a selection across an image that is mostly
red. Your rectangle will disappear. By using XOR, you are guaranteed
to get a rectangle that shows up with good contrast against the image
background.
> Are you saying that as I:
>
> event.Dragging() and even.LeftIsDown():
> # Refresh the background with the bitmap
> # draw a solid rectangle
Yes, if you really don't want XOR. As an optimization, you would want
to make sure that you don't redraw everything unless the coordinates of
the rectangle really have changed.
--
Tim Roberts, timr@[...].com
Providenza & Boekelheide, Inc.
_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
Thread:
Marlin Rowley
Tim Roberts
Marlin Rowley
Tim Roberts
Marlin Rowley
Christopher Barker
Marlin Rowley
Christopher Barker
Christopher Barker
Marlin Rowley
|