Wingraph - manipulating of Win32 GDI


NAME

Wingraph - manipulating of Win32 GDI

Back to Top


SYNOPSYS

 use Wingraph;
 $dc=new Wingraph(device=>'PS', desc=>'Desc' [, metafile=>'metafilename');

DESCRIPTION

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 Wingraph 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).

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).

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.

TextOut($x,$y,$s)
Draw using current fonr string $s at position $x,$y.

TextSize($s)
Return size of string $s using current font. Height and width return as array, first element is width, second - height.

FillRect($x,$y,$w,$h)
Draw rectagle with top left cornet at ($x,$y) and width equal to $w and height equal to $h, fill with current brush.

NextPage()
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.

Back to Top


AUTHOR

Copyright 2000 Ivan Frolcov.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Back to Top

 Wingraph - manipulating of Win32 GDI