Re: recommend a graphics library for plotting by the pixel?



On 2011-10-04, Ian Kelly wrote:

On Tue, Oct 4, 2011 at 3:56 AM, Adam Funk <a24061@xxxxxxxxxxxxx> wrote:
I'd like to create a window with a "pause" button and a large plotting
area, in which I'd like to draw a polygon, detect the pixel
coördinates of a mouse click, and then start setting the colors of
pixels by (x,y) coördinates.  (This is just for my own amusement, to
play with some formulas for generating fractals using random numbers.)

There seems to be a large number of different python GUI libraries,
and I wonder if someone can recommend the easiests one to learn for
this purpose?  (The only python graphics library I've used is PyGame,
which I don't think is the way to go here.)

You could use wxPython. You'll need to create a custom control and
have it paint itself by blitting from a wx.Bitmap, which you'll draw
on by using a wx.MemoryDC and then refreshing the control.

I would probably just use pygame myself. I guess you're avoiding it
because of the requirement for a button, but there are GUI libraries
available for it, or if all you need are a couple of buttons you could
easily roll your own.

Excellent suggestion. I got it to work, but using keypresses (pause,
step, quit) instead of buttons, and a mouse event for letting the user
pick the start point on the screen.


--
I worry that 10 or 15 years from now, [my daughter] will come to me
and say 'Daddy, where were you when they took freedom of the press
away from the Internet?' [Mike Godwin]
http://www.eff.org/
.



Relevant Pages

  • Re: recommend a graphics library for plotting by the pixel?
    ... area, in which I'd like to draw a polygon, detect the pixel ... There seems to be a large number of different python GUI libraries, ... You'll need to create a custom control and ... have it paint itself by blitting from a wx.Bitmap, which you'll draw ...
    (comp.lang.python)
  • Re: Anti-aliased drawing
    ... The problem will be modifying it to draw arc's, ... Dim ErrorAdj As Long, ErrorAcc As Long ... Dim ErrorAccTemp As Long, Weighting As Long ... ' Draw the initial pixel, ...
    (microsoft.public.vb.general.discussion)
  • Re: Draw pixel
    ... picture box, but instead draw right onto the form. ... simple example, I would want to draw a square, pixel by pixel to the ... Private Declare Function SetPixel Lib "gdi32" _ ...
    (comp.lang.basic.visual.misc)
  • Re: difference between drawrectangle and fillrectangle
    ... anti-aliasing. ... is at pixel 10.5, and the center of coordinate 12 is at pixel 12.5, the pen ... If you draw with SmoothingMode set to AntiAlias, you will see the fill now ... pens always draw a figure that is increased in width and height ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Graphics help please
    ... Actually, I don't think the code below helps me much with what I want to do (draw images pixel by pixel) as I don't want to clear the entire image before displaying the changes, which is effectively what happens below. ... The JPanel is buffered so that it doesn't actually clear the screen just the offscreen buffer. ... public void paintComponent{ ...
    (comp.lang.java.programmer)