I'm guessing I either have to define a -pagex, -pagey and then anchor on "center" or set the -x and -y. The problem is how do I determine what these values are? I've used $canvas->bbox("all") to capture the dimensions of my canvas. This allowed me to set my width and height but I could not set -x,-y or the -pagex,-pagey as the dimension values are are off by some factor. below is a snip of what I have tried but it jsut makes things worse:my @dim = $canvas->bbox("all"); my $width = ($dim[2]-$dim[0]); my $height = ($dim[3]-$dim[1]); my $ps = $canvas-> postscript( '-pagewidth' => "8 i", '-pageanchor' => "center", '-width' => $width, '-height' =>$height );
Does anyone know how tho convert the dim values so that I can use them in the -x,-y or -pagex,-pagey? Thanks in advance.my @dim = $canvas->bbox("all"); my $width = ($dim[2]-$dim[0]); my $height = ($dim[3]-$dim[1]); my $pagex = ($dim[0]+$dim[2])/2; my $pagey = ($dim[1]+$dim[3])/2; my $ps = $canvas-> postscript( '-pagewidth' => "8 i", '-pageanchor' => "center", '-pagex' => $pagex, '-pagey' => $pagey, # '-x' => $dim[0], # '-y' => $dim[1], '-width' => $width, '-height' =>$height );
In reply to Dumping Tk canvas to postscript by TooNewbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |