Skip to content

Conversation

@MatthiasSchilder
Copy link

Added wrapping of cairo_svg_surface_create_for_stream (cairo API docs).

I've extended the WinFormDemo-application to show usage.

image

Clicking on "tosvgstream" will create a SvgSurface, which is bound to a .NET memorystream. After writing is finished, the stream is reset, read and its string content is printed to Console:

image

Please feel free to make any proposals for improvement or just do them yourself.

@MatthiasSchilder
Copy link
Author

Added another commit which deals with the situation that the write_func delegate may be garbage-collected, even when the native code still needs it. This made the construction of a SvgSurface a little bit unaesthetic (initialization via constructor when you want to write to a file vs. via static method when you want to write to a stream), but I did not find another solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant