in reply to Pixel-based Plotting in Perl?
You will find however, that pixel plotting (single pixels) is VERY intensive, so you really want to use some sort of lines( actually curves, a line is just a straight curve :-))
You also might like to look at Tk Patio/Office layout designer for circles, polygons, etc. that are draggable.
Here is a sample of styles.
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = tkinit; $mw->geometry("600x440+100+100"); my $canvas = $mw->Canvas(-width => 600, -height => 400, -bg => 'black')->pack(); my $line; $line = $canvas->createLine(0,200,100,200,400,200,600,200, -width => 5, -smooth => 1, -splinesteps => 20, -fill => 'purple'); my $timer = $canvas->repeat(10,sub{ $canvas->delete($line); my @vals = ( 0, 200, 200, 200 + rand 300, 400, 200 - rand 300, 600, 2 +00); $line = $canvas->createLine( @vals, -width => 5, -smooth => 1, -splinesteps => 20, -fill => 'purple'); }); $mw->Button(-text=>'Quit',-command =>sub{exit})->pack; MainLoop;
|
|---|