Wingrpah - manipulating of Win32 GDI
use Wingraph; $dc=new Wingraph(device=>'PS', desc=>'Desc' [, metafile=>'metafilename');
This module allows you manipulate some subset of Win32 GDI. This subset includes a some drawing functions and device context related functions.
new(%params)
Create a new Wingrpah object. Parameters are pass as hash and have following meaning:
device
A name of printer to output or a name of referencing device if we creating metafile
desc
a description of print job or comment in metafile
metafile
if this parameters exists, then output do not really printed. In fact, metafiles with names $param{metafile} will be created, one for each page. First page will have name $param{metafile}, second - $param{metafile}++ and so on. All functions work with virtual coordinates, from 0 to 1000, center of coordinates placed in top left corner of drawing area, directed from left to right and from top to bottom.
LineTo($x, $y)
Set up a virtual pen to position ($x, $y).
($x, $y)
MoveTo($x, $y)
Draw a line from previous position of virual pen to ($x, $y) with current pen. Also change a current point of pen to ($x, $y).
SetBrush($int)
Set current brush to gray brush with intencity $int. Intencity may be from 0 (darknest) to 255 (lightest).
$int
SetPen($w)
Set current pen width to $w. Width of pen measured in pixels.
SetFont($fontname)
Set current font to $fontname. $fontname have the following format: "font name, size in points, charset". $charset may be omitted, in this case assumes charset 204.
$fontname
"font name, size in points, charset"
$charset
Draw using current fonr string $s at position $x,$y.
$s
$x,$y
Return size of string $s using current font. Height and width return as array, first element is width, second - height.
Draw rectagle with top left cornet at ($x,$y) and width equal to $w and height equal to $h, fill with current brush.
($x,$y)
$w
$h
Break current page and start new. If output directed to printer then pages are actually changed, if output directed to metafile, current file closed, $param{$metafile} incremented and new file created.
$param{$metafile}
2 POD Errors
The following errors were encountered while parsing the POD:
Unknown directive: =over4
'=item' outside of any '=over'
To install NPRG, copy and paste the appropriate command in to your terminal.
cpanm
cpanm NPRG
CPAN shell
perl -MCPAN -e shell install NPRG
For more information on module installation, please visit the detailed CPAN module installation guide.