nuget server logo nuget api documents
↑

API Docs / Microsoft.VisualBasic.Imaging / Writer

Writer

Full name Microsoft.VisualBasic.Imaging.PostScript.Writer Assembly Microsoft.VisualBasic.Imaging Members 22

file writer for the postscript file

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

Microsoft.VisualBasic.Imaging.PostScript.Writer

02 Methods

NameOverloadsSummary
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

NameOverloadsSummary
canvasHeight 1 the canvas height in the gdi+ coordinate space.

04 Members

method Yf #
Yf(Single)

flip a gdi+ y coordinate (top-left origin) into a postscript y coordinate (bottom-left origin).

method pen #
pen(Stroke)

A helper function for make conversion from the css stroke object to the gdi+ pen object

Parameters
NameTypeDescription
strokeStroke

-

method moveto overload 2 #
moveto(Single, Single)

moveto

Parameters
NameTypeDescription
x!Single

-

y!Single

-

method moveto #
moveto(PointF)

moveto

method text overload 2 #
text(String, Single, Single)

show text at the given gdi+ location

Parameters
NameTypeDescription
sString

-

x!Single

-

y!Single

-

method text #
text(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.

method circle #
circle(PointF, Single)

stroke a circle outline at the given center with the given radius

method fillCircle #
fillCircle(PointF, Single)

fill a circle at the given center with the given radius

method arct #
arct(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.

Parameters
NameTypeDescription
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

method stroke #
stroke

stroke

method fill #
fill

fill the current path

method rectangle #
rectangle(RectangleF, String, Stroke)

draw a rectangle with optional fill color and optional stroke border.

Parameters
NameTypeDescription
rectRectangleF

the rectangle in gdi+ coordinate space

fillColorString

the html color string of the fill, or nothing/empty to skip filling

borderStroke

the css stroke of the border, or nothing to skip stroking

method dash #
dash(Int32())

setdash

Parameters
NameTypeDescription
dashInt32()

-

method linewidth #
linewidth(Single)

setlinewidth

Parameters
NameTypeDescription
widthSingle

-

method color overload 2 #
color(Single, Single, Single)

setrgbcolor

Remarks

the rgb color value parameter should be in value range of [0,1]

Parameters
NameTypeDescription
rSingle

-

gSingle

-

bSingle

-

method color #
color(Color)

setrgbcolor

Parameters
NameTypeDescription
colorColor

-

method setgray #
setgray(Single)

setgray

method font #
font(String, Single)

setfont

Parameters
NameTypeDescription
nameString

-

fontsize!Single

-

method note #
note(String)

write comment text

Parameters
NameTypeDescription
noteTextString

the comment text that may contains multiple data lines

method comment #
comment(String)

write a line of comment text

Parameters
NameTypeDescription
lineString

-

method showpage #
showpage

[showpage] mark the end of current page

field canvasHeight #
canvasHeight

the canvas height in the gdi+ coordinate space. used for flip the y axis.