La bibliothèque se documente elle-même · Graphisme
stzCanvas
41 méthodes propres · 25 formes avec extensions, rangées sous leur méthode
la source: base/graphics/stzCanvas.ring(s'ouvre dans un nouvel onglet) · Toutes les classes · La référence du domaine : Graphisme
Sous chaque méthode, ses extensions (Q CS XT Z ZZ IB W U) : en gras et cochée, elle existe ; barrée, elle n'existe pas. Les extensions et leur sens
Exemples : 0 viennent des tests de la bibliothèque ; 8 ont été composés à partir de la signature de chaque méthode et exécutés pour cette page, sur un objet neuf, par exemple o1 = new stzCanvas(1240, 1000). 33 méthodes n'en ont pas encore. Exemples exécutés le 2026-10-03 12:54 dans la bibliothèque au commit 0e72e2e2c.
Méthode
Explication, telle que la source la porte
init
(sans commentaire dans la source : le nom se lit comme une phrase) initaucune extension
Id_
identityaucune extension
Width
(sans commentaire dans la source : le nom se lit comme une phrase) widthaucune extension
exemple composé
o1 = new stzCanvas(1240, 1000) ? o1.Width() #--> 1240composé à partir de la signature, exécuté pour cette page
Height
(sans commentaire dans la source : le nom se lit comme une phrase) heightaucune extension
exemple composé
o1 = new stzCanvas(1240, 1000) ? o1.Height() #--> 1000composé à partir de la signature, exécuté pour cette page
ShapeCount
(sans commentaire dans la source : le nom se lit comme une phrase) shape countaucune extension
exemple composé
o1 = new stzCanvas(1240, 1000) ? o1.ShapeCount() #--> 0composé à partir de la signature, exécuté pour cette page
Stats
[ shapes, shapeVertices, textVertices, drawSegments, builds ]aucune extension
exemple composé
o1 = new stzCanvas(1240, 1000) ? @@( o1.Stats() ) #--> [ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 ]composé à partir de la signature, exécuté pour cette page
SetBackground
canvas-wide stateQCSXTZZZIBWU
SetFont
(sans commentaire dans la source : le nom se lit comme une phrase) set fontQCSXTZZZIBWU
AddRect
adding shapesQCSXTZZZIBWU
exemple composé
o1 = new stzCanvas(1240, 1000) o1.AddRect(2, 5, 2, 2) ? o1.Content() #--> <svg xmlns="http://www.w3.org/2000/svg" width="1240" height="1000" viewBox="0 0 1240 1000"> #--> <rect x="2" y="5" width="2" height="2" fill="rgb(255,255,255)"/> #--> </svg>composé à partir de la signature, exécuté pour cette page
AddGradientRect
A rectangle whose fill runs from one colour to another; bVertical picks the axis.QCSXTZZZIBWU
AddCircle
(sans commentaire dans la source : le nom se lit comme une phrase) add circleQCSXTZZZIBWU
exemple composé
o1 = new stzCanvas(1240, 1000) o1.AddCircle(2, 5, 2) ? o1.Content() #--> <svg xmlns="http://www.w3.org/2000/svg" width="1240" height="1000" viewBox="0 0 1240 1000"> #--> <circle cx="2" cy="5" r="2" fill="rgb(255,255,255)"/> #--> </svg>composé à partir de la signature, exécuté pour cette page
AddRoundRect
A ROUNDED rectangle -- the visual signature of every diagram graphviz draws with style=rounded, which is what an org chart looks like.QCSXTZZZIBWU
AddEllipse
The primitive the DIAGRAM layer was missing. Of graphviz's 24 node shapes, twenty are a circle, a rect or a polygon -- all already here -- and the remaining four (ellipse, egg, cylinder, doublecircle) all need this one. Tessellated engine-side, on the same segment bound as the circle, so a stroked ellipse traces exactly the filled one.QCSXTZZZIBWU
AddImage
Both tiers carry it: the GPU draws a textured quad, and ToSVG() embeds a base64 PNG -- so a picture with a spectrogram in it is still one self-contained file that needs no device.QCSXTZZZIBWU
AddMesh
paVerts is flat -- x, y, r, g, b, a per vertex, pixel space, channels 0..255. paIndices is 0-based triangle indices into it. Both tiers carry it: the GPU draws the triangles through the ordinary shape pipeline (no new shader, no extra draw call), and ToSVG() emits one <polygon> per triangle -- exact for flat-coloured UI geometry, an approximation for a gradient mesh, where the GPU interpolates and SVG cannot.QCSXTZZZIBWU
AddLine
(sans commentaire dans la source : le nom se lit comme une phrase) add lineQCSXTZZZIBWU
AddPolyline
paPoints is flat: [ x1,y1, x2,y2, ... ]QCSXTZZZIBWU
AddPolygon
(sans commentaire dans la source : le nom se lit comme une phrase) add polygonQCSXTZZZIBWU
AddText
(pnX, pnY) is the BASELINE origin -- where the text sits, not its box.QCSXTZZZIBWU
AddVerticalText
A Latin word inside a column stands upright here, one letter under the next, where a reader would expect it lying on its side. That is named as a limit in SOFTANZA_GRAPHICS_PLAN.md rather than implied.QCSXTZZZIBWU
AddJustifiedText
The engine elongates first and shares whatever is left over the spaces, so the line lands on the width exactly. A width no greater than the text's own leaves the text alone: this stretches, and it never compresses.QCSXTZZZIBWU
Fill
Either way it NAMES the fill, and that flag is what lets a stroke-only shape exist: see _Flush. A shape whose fill was never named and which WAS given a stroke is an outline, not a white blob.QCSXTZZZIBWU
Color
Text reads better as Color(); same act.QCSXTZZZIBWU
Stroke
An outline in its own colour and width. On a filled shape it is drawn ON TOP of the fill, so the two agree on the silhouette.QCSXTZZZIBWU
SetPickTag
A tag rather than a shape index, because a node is several commands -- a fill, a stroke, a label -- and every one of them is the same node to a reader pointing at it. Zero is "no identity", which is what backgrounds and decorations keep.aucune extension
SetSvgIdent
REFUSES a name that is not an XML name rather than escaping it. A name that arrives as `a b"c` and leaves as `a b"c` is one the consumer cannot write down or select on -- the mangling would be discovered by them and the refusal is discovered here.aucune extension
ClearSvgIdent
Back to no identity -- the next shapes belong to no element.aucune extension
Pick
The tag of the TOPMOST tagged shape under a point, or 0 for bare paper. Read straight from the retained display list: the data is already engine-side, so a click costs one crossing and no copy.QCSXTZZZIBWU
exemple composé
o1 = new stzCanvas(1240, 1000) ? o1.Pick(2, 5) #--> 0composé à partir de la signature, exécuté pour cette page
SetRegion
Panning a viewer over a huge diagram is the same call with a different origin, which is why this is one feature and not two.aucune extension
ClearRegion
Back to the whole picture.aucune extension
ToSVG
Vector. Needs NO device -- always available, everywhere.aussi écrite: Contentaucune extension
ToPNG
Four is the knee and the rest is a bad trade: five through seven buy 1.3% for another 2.4 ms, and nine spends 5.1x the time of one to beat four by 4%. So four is the default and the dial is exposed, because a caller writing one file for a page and a caller writing nine hundred for a test suite are not answering the same question.QCSXTZZZIBWU
ToPNGHiRes
4x MSAA antialiases a shape's edges and still beads a thin near-axis line light and dark along its length: its four samples are fixed, so a half-pixel diagonal catches them unevenly. Rendering at 2x gives sixteen effective samples where the line is and the bead fills in. It is not the default -- a test that compares rendered bytes wants the plain render, and a nine-hundred-file suite does not want to pay 4x the fill -- so a FIGURE meant to be shown asks for it and a check does not. Two is the knee; three and four are for print.QCSXTZZZIBWU
ToPixels
Raw RGBA8 bytes of the GPU tier, for a caller that wants the pixels themselves (comparisons, compositing, tests).aucune extension
ToPixelsHiRes
...and the supersampled pixels, box-averaged down: what ToPNGHiRes writes, for a caller that wants the bytes rather than a file.aucune extension
CanDrawPixels
(sans commentaire dans la source : le nom se lit comme une phrase) can draw pixelsaucune extension
Flush
AND A CALLER CLOSING A GROUP OF SHAPES, which is the second reason and was found the hard way. SetFont, Fill and Stroke are deliberately RETROACTIVE on a pending shape -- that is what makes AddTextQ(..).Fill(..) work -- so the LAST shape of a group stays open until something else is added. A label engine drew ninety-six names and then wrote a caption at another size, and the caption resized the ninety-sixth name. Flush() is how a group is closed on purpose.QCSXTZZZIBWU
Resize
Empty the display list, keeping the background and the GPU buffers. What an ANIMATED canvas calls at the top of each frame -- without it the list grows by a frame's worth of shapes forever. Change the canvas's extents. The engine scene and this face are resized by the SAME call, so Width()/Height() cannot drift from what is actually being drawn -- which they did, silently, the first time a window retargeted a canvas: the face kept answering its construction size while the scene had moved on.QCSXTZZZIBWU
exemple composé
o1 = new stzCanvas(1240, 1000) ? o1.Resize(2, 5) #--> 1composé à partir de la signature, exécuté pour cette page
Clear
(sans commentaire dans la source : le nom se lit comme une phrase) clearQCSXTZZZIBWU
Show
Put the picture in front of a person. A real WINDOW when this machine has one (GR5) -- Escape or the X button closes it, and the picture never touches the disk. Otherwise the old path: write a PNG (or an SVG with no device) and ask the OS to open it, which is what a headless box or a machine without stz_window.dll still deserves. Returns the frame count when it opened a window, the file path when it fell back -- so a caller can always tell which happened.aucune extension
Free
(sans commentaire dans la source : le nom se lit comme une phrase) freeaucune extension

