VectorGraphics
VectorGraphics
סקירה כללית
VectorGraphics היא מחלקה ב-Aspose.PDF FOSS עבור TypeScript.
בונה מתווסף לתוכן וקטורי: כל בנאי נתיב, מפעיל צבע, הגדרת מצב גרפיקה וסוגר תוכן מסומן, מצטברים בזיכרון כטקסט של מפעילים.
מחלקה זו מכריזה על 41 שיטות עבור עצמים VectorGraphics בתוכניות TypeScript. השיטות הזמינות כוללות: BeginArtifact, BeginLayer, BeginMarkedContent, EndLayer, EndMarkedContent, arc, circle, close, curveTo, drawLine, drawRect, ellipse, ו-25 שיטות נוספות. כל החברים הציבוריים נגישים לכל יישום TypeScript לאחר התקנת חבילת Aspose.PDF FOSS עבור TypeScript. מאפיינים: ctm, liveMask, ref.
מאפיינים
| שם | סוג | גישה | תיאור |
|---|---|---|---|
ctm | : Matrix | קריאה | מקבל את ה-ctm. |
liveMask | : PaintChannel | קריאה | מקבל את המסכה החיה. |
ref | : unknown | קריאה | מקבל את ההפנייה. |
שיטות
| חתימה | תיאור |
|---|---|
setLineWidth(w: number) → this | מגדיר את ערך רוחב הקו. |
setStrokeColor(rgb: [number, number, number]) → this | מגדיר את ערך צבע הקו. |
setFillColor(rgb: [number, number, number]) → this | מגדיר את ערך צבע המילוי. |
setFillGradient(g: Gradient) → this | מלא את הנתיבים הבאים במעבר צירי או רדיאלי. |
setStrokeGradient(g: Gradient) → this | צייר קו מתאר לנתיבים הבאים במעבר צירי או רדיאלי. |
setFillPattern(pattern: ColoredTilingPattern) → this | מלא את הנתיבים הבאים ב-pattern, תבנית ריצוף מ- {@link Document.NewTilingPattern}. |
setFillPattern(pattern: UncoloredTilingPattern, color: [number, number, number]) → this | מגדיר את ערך תבנית המילוי. |
setFillPattern(pattern: TilingPattern, color: [number, number, number]) → this | מגדיר את ערך תבנית המילוי. |
setStrokePattern(pattern: ColoredTilingPattern) → this | הקף נתיבים נוספים עם pattern. |
setStrokePattern(pattern: UncoloredTilingPattern, color: [number, number, number]) → this | מגדיר את ערך דפוס הקו. |
setStrokePattern(pattern: TilingPattern, color: [number, number, number]) → this | מגדיר את ערך תבנית הקו. |
| `setLineCap(cap: 0 | 1 |
| `setLineJoin(join: 0 | 1 |
setMiterLimit(limit: number) → this | מגבלת חיבור משולש: היחס שבו חיבור משולש (setLineJoin(0)) נחתך לקצה משופע. |
setDash(pattern: number[], phase) → this | מגדיר את ערך הקו המקווקו. |
setOpacity(alpha: number) → this | מגדיר את ערך השקיפות. |
save() → this | קורא ל-save על מופע VectorGraphics זה. |
restore() → this | קורא ל-restore על מופע VectorGraphics זה. |
transform(a: number, b: number, c: number, d: number, e: number, f: number) → this | קורא transform(a, b, c, d, e, f) על מופע VectorGraphics זה. |
BeginMarkedContent(tag: string, mcid: number) → this | התחיל רצף תוכן מסומן שנושא /MCID. |
BeginArtifact() → this | התחיל רצף חפץ: /Artifact BMC, מסמן שהפעולות הבאות הן תוכן שאינו שייך לאלמנט מבנה. |
EndMarkedContent() → this | סיים את רצף התוכן המסומן האחרון. |
BeginLayer(layer: Layer) → this | התחל רצף תוכן אופציונלי: /OC /<key> BDC, מתייג את הפעולות הבאות אל layer. |
EndLayer() → this | סיים את רצף {@link BeginLayer} האחרון. |
moveTo(x: number, y: number) → this | קורא ל-moveTo(x, y) על מופע VectorGraphics זה. |
lineTo(x: number, y: number) → this | קורא ל-lineTo(x, y) על מופע VectorGraphics זה. |
curveTo(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number) → this | קורא ל-curveTo(x1, y1, x2, y2, x3, y3) על המופע VectorGraphics הזה. |
rect(x: number, y: number, w: number, h: number) → this | קורא ל-rect(x, y, w, h) על מופע VectorGraphics זה. |
close() → this | קורא ל-close על מופע VectorGraphics זה. |
drawLine(x1: number, y1: number, x2: number, y2: number) → this | קורא ל-drawLine(x1, y1, x2, y2) על מופע VectorGraphics זה. |
drawRect(x: number, y: number, w: number, h: number) → this | קורא ל-drawRect(x, y, w, h) על מופע VectorGraphics זה. |
circle(cx: number, cy: number, r: number) → this | קורא ל-circle(cx, cy, r) על מופע VectorGraphics זה. |
polyline(points: [number, number][]) → this | קו פתוח (polyline) דרך points (לפחות שני זוגות [x, y]): moveTo ולאחריו lineTo לכל אחד. |
polygon(points: [number, number][]) → this | צורה סגורה (polygon) דרך points: {@link polyline} בתוספת h סגורה, כך שמילוי מקבל גבול מוגדר היטב וקו מתאר מצרף את הקצה האחרון לראשון במקום לסגור אותו. |
roundedRect(x: number, y: number, w: number, h: number, r: number) → this | מלבן עם פינות רבע-מעגל ברדיוס r, מוגבל לחצי מהצלע הקצרה (כך שרדיוס גדול מדי יוצר צורת סטאדיום, ולא מסלול חוצה את עצמו). |
arc(cx: number, cy: number, r: number, startAngle: number, endAngle: number) → this | קשת מעגלית של רדיוס r על (cx, cy), מ- startAngle to endAngle in radians (0 = ציר +x, עולה נגד כיוון השעון, כמו ב-Canvas 2D). |
ellipse(cx: number, cy: number, rx: number, ry: number) → this | קורא ל-ellipse(cx, cy, rx, ry) על המופע VectorGraphics הזה. |
stroke() → this | קורא ל-stroke על המופע VectorGraphics הזה. |
fill() → this | קורא ל-fill על מופע VectorGraphics זה. |
fillEvenOdd() → this | קורא ל-fillEvenOdd על מופע VectorGraphics זה. |
fillStroke() → this | קורא ל-fillStroke על מופע VectorGraphics זה. |