[wxPython-users] dc.DrawCircle is not very circular

Christopher Barker Chris.Barker at noaa.gov
Mon Feb 25 09:50:31 PST 2008


Frank Millman wrote:
> Thanks a lot for the ideas.

No problem.

> I downloaded InkScape, and it looks very nice indeed. However, I have never
> used a drawing program before, so it is taking me a long time to achieve
> simple things.

It does take a while to get the hang of.

> Attached is the results of my efforts so far. It shows my original attempt
> using a normal DC, my second attempt using a GraphicsContext, and my third
> attempt using my own bitmap created with Inkscape. I had to scale the bitmap
> - I think InkScape uses a higher resolution.

Inkscape is a vector graphics program -- it doesn't use any particular 
resolution. When you want a bitmap version, you do:

File => Export Bitmap

then you can select any resolution you want (you probably want to export 
either "drawing" or "selection". I often start with and invisible 
square, then put everything else inside it, so that I can be sure to get 
a square drawing when I want to export the bitmap.

This works great for Icons for programs, you can export various sizes of 
bitmaps from the same drawing, very nicely rendered.

> I am sure I can improve the bitmap considerably, but at this stage the
> second version comes out well enough, so I think I will stick with the
> GraphicsContext for now.

It's a fine way to go.

> I want to avoid too many dependencies in my program, and I believe that
> FloatCanvas requires Numpy,

yes it does, but is a simple "easy_install numpy" such a big deal?

 > which I do not need at present,

That's what you think now -- but don't underestimate the glory of numpy! ;-)

> I can later on add functionality much more
> easily than if I was dependent on a 3rd-party product.

well, yes, there is something to be said for working with your own, 
familiar code.

> Still open to any suggestions, though.

If you want to be able to zoom and pan around your image -- you really 
do want to check out FloatCanvas.

> Thanks again for the feedback - InkScape has certainly opened my eyes to
> what is possible.

it is a very nice program.

-Chris


-- 
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

Chris.Barker at noaa.gov




More information about the wxpython-users mailing list