Wingraph - manipulating of Win32 GDI


Wingraph - manipulating of Win32 GDI

Back to Top


 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.

 Create a new Wingraph object. Parameters are pass as hash and have following
A name of printer to output or a name of referencing device if we creating metafile

a description of print job or comment in 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).

Set current brush to gray brush with intencity $int. Intencity may be from 0 (darknest) to 255 (lightest).

Set current pen width to $w. Width of pen measured in pixels.

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.

Draw using current fonr string $s at position $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.

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


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