ReSVGMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

ReSVGMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class SVG MBS Images Plugin 23.0 ✅ Yes ✅ Yes ✅ Yes ❌ No Desktop, Console & Web
A class to render SVG data to a picture.
Example

// we load this file
Dim file As FolderItem = SpecialFolder.Desktop.Child("test.svg")

Dim p As New ReSVGMBS(file)

// and render them in their normal size:
Dim pic As picture = p.RenderToPicture(p.Width, p.Height)

// show in the window
Window1.Backdrop = pic

This uses the ReSVG library written in Rust.
ReSVG is a fast, small, portable SVG library with the goal to support the whole SVG spec.

see
https://github.com/RazrFalcon/resvg

Errors

Constant Value Description
kErrorElementsLimitReached 4 We do not allow SVG with more than 1_000_000 elements for security reasons.
kErrorFileOpenFailed 2 Failed to open the provided file.
kErrorInvalidSize 5 SVG doesn't have a valid size.
Occurs when width and/or height are <= 0.
Also occurs if width, height and viewBox are not set.
kErrorMalformedGZip 3 Compressed SVG must use the GZip algorithm.
kErrorNotAnUTF8String 1 Only UTF-8 content are supported.
kErrorOK 0 Everything is ok.
kErrorParsingFailed 6 Failed to parse an SVG data.

Fit Types

Constant Value Description
kFitToTypeHeight 2 Fit an image to a specified height.
kFitToTypeOriginal 0 Use an original image size.
kFitToTypeWidth 1 Fit an image to a specified width.
kFitToTypeZoom 3 Zoom an image using scaling factor.

Image Rendering

Constant Value Description
kImageRenderingOptimizeQuality 0 Optimize for quality
kImageRenderingOptimizeSpeed 1 Optimize for speed

Shape Renderings

Constant Value Description
kShapeRenderingCrispEdges 1 Crisp Edges
kShapeRenderingGeometricPrecision 2 Geometric precision
kShapeRenderingOptimizeSpeed 0 Optimize speed

Text Renderings

Constant Value Description
kTextRenderingGeometricPrecision 2 Geometric precision
kTextRenderingOptimizeLegibility 1 Optimize legibility
kTextRenderingOptimizeSpeed 0 Optimize for speed

This class has no sub classes.

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Release notes


The items on this page are in the following plugins: MBS Images Plugin.


ResStreamMBS   -   RFCClassDescriptionMBS


💬 Ask a question or report a problem