file writer for the postscript file
Writer
00 Remarks
The postscript coordinate system has its origin at the bottom-left corner with the y axis pointing up, which is the opposite of the GDI+ top-left origin. For that reason every geometry coordinate that is written through this writer is flipped on the y axis by Writer.Yf() so that the generated postscript file looks identical to a GDI+ drawing. Text is kept upright because it does not depend on a negative scale transform.
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| Yf | 1 | flip a gdi+ y coordinate (top-left origin) into a postscript y coordinate (bottom-left origin). |
| pen | 1 | A helper function for make conversion from the css stroke object to the gdi+ pen object |
| moveto | 2 | moveto |
| text | 2 | show text at the given gdi+ location with an additional rotation. |
| circle | 1 | stroke a circle outline at the given center with the given radius |
| fillCircle | 1 | fill a circle at the given center with the given radius |
| arct | 1 | a correct postscript elliptical arc based on the gdi+ ellipse definition. |
| stroke | 1 | stroke |
| fill | 1 | fill the current path |
| rectangle | 1 | draw a rectangle with optional fill color and optional stroke border. |
| dash | 1 | setdash |
| linewidth | 1 | setlinewidth |
| color | 2 | setrgbcolor |
| setgray | 1 | setgray |
| font | 1 | setfont |
| note | 1 | write comment text |
| comment | 1 | write a line of comment text |
| showpage | 1 | [showpage] mark the end of current page |
03 Fields
| Name | Overloads | Summary |
|---|---|---|
| canvasHeight | 1 | the canvas height in the gdi+ coordinate space. |
04 Members
Single)flip a gdi+ y coordinate (top-left origin) into a postscript y coordinate (bottom-left origin).
Stroke)A helper function for make conversion from the css stroke object to the gdi+ pen object
| Name | Type | Description |
|---|---|---|
stroke | Stroke | - |
Single, Single)moveto
| Name | Type | Description |
|---|---|---|
x! | Single | - |
y! | Single | - |
PointF)moveto
String, Single, Single)show text at the given gdi+ location
| Name | Type | Description |
|---|---|---|
s | String | - |
x! | Single | - |
y! | Single | - |
String, Single, Single, Single)show text at the given gdi+ location with an additional rotation. the rotation follows the gdi+ convention (clockwise, positive angle), which is mapped to a negative postscript rotation because of the y flip.
PointF, Single)stroke a circle outline at the given center with the given radius
PointF, Single)fill a circle at the given center with the given radius
Single, Single, Single, Single, Single, Single)a correct postscript elliptical arc based on the gdi+ ellipse definition. the arc is closed by Writer.closepath() and should be followed by Writer.stroke() or Writer.fill() by the caller.
| Name | Type | Description |
|---|---|---|
x! | Single | left of the bounding rectangle (gdi+ space) |
y! | Single | top of the bounding rectangle (gdi+ space) |
width! | Single | width of the bounding rectangle |
height! | Single | height of the bounding rectangle |
startAngle! | Single | start angle, degree, clockwise in gdi+ convention |
sweepAngle! | Single | sweep angle, degree, clockwise in gdi+ convention |
stroke
fill the current path
RectangleF, String, Stroke)draw a rectangle with optional fill color and optional stroke border.
| Name | Type | Description |
|---|---|---|
rect | RectangleF | the rectangle in gdi+ coordinate space |
fillColor | String | the html color string of the fill, or nothing/empty to skip filling |
border | Stroke | the css stroke of the border, or nothing to skip stroking |
Int32())setdash
| Name | Type | Description |
|---|---|---|
dash | Int32() | - |
Single)setlinewidth
| Name | Type | Description |
|---|---|---|
width | Single | - |
Single, Single, Single)setrgbcolor
the rgb color value parameter should be in value range of [0,1]
| Name | Type | Description |
|---|---|---|
r | Single | - |
g | Single | - |
b | Single | - |
Color)setrgbcolor
| Name | Type | Description |
|---|---|---|
color | Color | - |
Single)setgray
String, Single)setfont
| Name | Type | Description |
|---|---|---|
name | String | - |
fontsize! | Single | - |
String)write comment text
| Name | Type | Description |
|---|---|---|
noteText | String | the comment text that may contains multiple data lines |
String)write a line of comment text
| Name | Type | Description |
|---|---|---|
line | String | - |
[showpage] mark the end of current page
the canvas height in the gdi+ coordinate space. used for flip the y axis.