Hi Jamie,

Thanks for your interest.

Jamie Bullock wrote:
> What I would like to do is give the line a gradient so it appears to
> have a 'head' and a 'tail' (which gradually fades out). If the line
> supported an alpha channel setting for each point I guess this could be
> done by incrementally decreasing the alpha value towards the end.

Or by making the line narrower and narrower, which could look good if 
the drawing was done with sub-pixel accuracy and well anti-aliased.

> Is there an existing way to do this with FC,

I'm afraid not. FC currently uses the wx.DC for all it's rendering, and 
   DCs doesn't support alpha, gradients, anti-aliasing. or sub-pixel 
rendering.

 > or should I put in a feature request?

Consider the request in.

However, the key is that FC needs to be converted to using the new 
wx.GraphicsContext, which supports most (if not all) of these features. 
The issues with doing that are:

1) GraphicsContext can be a fair bit slower for rendering that DC -- 
only an issue if you are drawing lots of complex objects, but I, for one 
am doing that sometimes.

2) Someone needs to write the code, and I don't have much time for it 
right now.

3) We need to decide how to do it -- it would be nice to allow both ways 
- simple objects drawn with DCs (for performance and backward 
compatibility), and GraphicsContext used where required. In theory, this 
should be possible, as all the drawing is done to wx.Bitmap, and so you 
should be able to draw parts of it with a DC, and parts with a GC, but 
it may require some backward-incompatible changes. The way it's written 
now, every DrawObject has a _draw() method that takes a DC and draws to 
it. If we pass in a GC instead, all the draw() methods will need to be 
rewritten.

Another option is to pass in the wx.Bitmap to each object instead, and 
have each object create either a Memory DC or GraphicsContext as it 
needs, but I'm a bit concerned about the overhead re-creating the DC or 
GC for every object.

In short -- there's a lot of work to do, designing testing and 
refactoring. I'm happy for any contributions.

We should also take a close look at the work being done on pyGEF -- 
which, If I understand it, started because FloatCanvas was missing some 
of what was needed. Anyway, it would be nice for the two projects to 
take advantage of each-other's work, and, at the very least, work together.

http://sourceforge.net/projects/pygef

Retief, are you still on this list?

-Chris

PS: I thought there was a GraphicsContextDC, but I can't seem to find it 
in the wx docs:
http://www.wxpython.org/onlinedocs.php
anyone know where its docs are?




-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[EMAIL PROTECTED]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to