Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Using GD on MS Windows

by SparkyEE (Initiate)
on Aug 29, 2006 at 15:45 UTC ( [id://570196]=note: print w/replies, xml ) Need Help??


in reply to Re: Using GD on MS Windows
in thread Using GD on MS Windows

Thank you! and Ugh.. So I'd have to simultaneously draw the canvas using Tk and draw the image in GD. Are there any other options to display a graph and then save it using one module??

Win32::Gui - no drawing function?
Imager - doesn't spawn a desktop window (like GD)
Magick - Do i really have to force users to install another application?
GD - does not display
Tk - does not save canvas?

Replies are listed 'Best First'.
Re^3: Using GD on MS Windows
by strat (Canon) on Aug 30, 2006 at 08:41 UTC

    The following way should work with Tk (haven't tested it):

    use MIME::Base64; # ... your GD code from above my $imageData = $image->png; # save $imageData to file with binmde... well you know that... open( my $PNG, ">", $imageFilename ) or die ...; binmode( $PNG ); print $PNG $imageData; close( $PNG ) or die ...; # convert $image to tk photo my $imageData64 = MIME::Base64::encode_base64( $imageData ); my $photo = $mw->Photo( -format => 'png', -data => $imageData64, ); # do something with $photo...

    I used a similar way for a little slideshow I wrote...

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"

Re^3: Using GD on MS Windows
by Solo (Deacon) on Aug 29, 2006 at 17:19 UTC
    GraphViz works well for me on Win32, and there's Tk::GraphViz, though I've never used it.

    --Solo

    --
    You said you wanted to be around when I made a mistake; well, this could be it, sweetheart.
Re^3: Using GD on MS Windows
by ww (Archbishop) on Aug 29, 2006 at 17:26 UTC
    I don't think your reply, at Re^2: Using GD on MS Windows , follows either from your original post, nor from the excellent answer, above.

    Just what is it that you want to achieve?
    Guesses:

    • Create an image to be saved as a .png file?
    • Draw a graph, live and atop the windows desktop, from some (streaming?) input data?

    If the former, you have the answer above, and came close with your adaptation of the original sample code (which could be edited to specify a file write, rather than output to STDPUT which must then be redirected. If the latter, you may which to ppm -s for the various Graph:: modules.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://570196]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (8)
As of 2024-04-23 09:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found