ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxpython-users
wxpython-users
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved