GraffitiSVG

View Categories

Preview #

About #

GraffitiSVG provides an API for rendering SVG to Xojo Picture objects.

Requirements #

Enumerations #

This class exposes no enumerations.

Constants #

This class exposes no constants.

Events #

This class exposes no events.

Methods #

This class exposes no methods.

Shared Methods #

NameParametersReturn TypeDescription
Initializecallback as InitializedCallback = nilNoneInitializes the control and calls the InitializedCallback delegate when ready. Required in the App.Opening Event Handler.
Renderdata as String
width as Integer = 1000
height as Integer = 1000
PictureRenders and returns an image for the SVG data specified by the parameters.

Delegates #

NameParametersReturn TypeDescription
InitializedCallbackNoneNoneDelegate used with the Initialize method to signal the class is ready.

Properties #

This class exposes no properties.

Examples #

Initializing #

GraffitiSVG must be initialized before use. The following can be added to the App.Opening event:

GraffitiSVG.Initialize

Due to the asynchronous nature of the class, you may wish to initialize then cache returned icons. Note that icon is a property of the class where you wish to use GraffitiSVG, and renderIcon is the name of the delegate method.

Private Sub renderIcon()
  icon = GraffitiFontAwesome.Render( GraffitiFontAwesome.IconTypes.Solid, "search", &cFFFFFF, me.Width, me.Height )
  
  self.Refresh
End Sub
Sub Opening Handles Opening
  GraffitiSVG.Initialize( AddressOf renderIcon )
End Sub

Caching, however, is not required, and once the class is initialized then you may use it as though it were a normal synchronous class by simply calling the delegate method to refresh the icon or calling the Render method directly from within Paint events.