Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
There are a few options, none of which are AFAICT perfect for what you're wanting.

GD, GD::Simple and Image::Magick will let you work with graphics files and save them. Then you'll need something to display those files.

Tk, The GIMP (perhaps with Gimp::Fu managing it), a browser, Prima (particularly Prima::Image perhaps), wxWidgets (with Wx, or something could take care of the display.

Some of those graphics loaders and GUI toolkits let you draw point by point in them, too. See Prima::Drawable and Tk::Canvas.

You can also tie into SDL and OpenGL (perhaps OpenGL::Simple). Those will give you even more graphics control than you're probably looking to use. You can even use SDL n conjunction with OpenGL or WxWidgets in conjunction with OpenGL.

There are Gtk and Qt, which are the graphics toolkits for Gnome and KDE.

Perhaps you're looking for something like Graphics::Simple, which is much like what some languages close to the metal of their platforms used to handle. It's marked as alpha and uses GTK or Postscript back ends.

You don't really say whether you want to show the drawing in progress on the screen or to show the result. Some of these options only really fit well into the completed image work flow. Others work well with updating the graphics on screen as you add or change elements. SDL, OpenGL, Tk, Prima, Gtk, Qt, and Graphics::Simple seem to be among those.

Portability is another issue. Tk, SDL, OpenGL, Qt, and Gtk can be used on most platforms but require the relevant libraries to be there. Prima is an option in Perl, but the others have bindings for other languages.

Your main issue here is that Perl is widget/toolkit/canvas ambivalent. The dialect of Basic you mentioned was tied tightly to the nature of the computer that drew the pixels for it. Once you pick a way to display your pixels, your application will be tied to some library unless you go the extra mile to make a handle of them interchangeable back ends. (That would be a neat trick, and many people would appreciate a module that wrapped Qt, Gtk, Prima, Tk, and SDL's graphics with a unified API. I doubt you're interested in doing that much work on it, though).

In reply to Re: Pixel-based Plotting in Perl? by mr_mischief
in thread Pixel-based Plotting in Perl? by pat_mc

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2022-05-21 09:39 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (76 votes). Check out past polls.