You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some example code of how to use this in Xamarin would be helpful in the README. I was able to get it working, in case this helps anyone else:
public static void SetSvgFromBytes (this ImageView imageView, byte[] bytes, int width, int height) {
// Load the SVG from the bytes.
var stream = new MemoryStream (bytes);
var svg = SVG.GetFromInputStream (stream);
// Create a Bitmap to render our SVG to.
var bitmap = Bitmap.CreateBitmap (width, height, Bitmap.Config.Argb8888);
// Create a Canvas to use for rendering.
var canvas = new Canvas (bitmap);
canvas.DrawRGB (255, 255, 255);
// Now render the SVG to the Canvas.
svg.RenderToCanvas (canvas);
// Finally, populate the imageview from the Bitmap.
imageView.SetImageBitmap (bitmap);
}
The text was updated successfully, but these errors were encountered:
Some example code of how to use this in Xamarin would be helpful in the README. I was able to get it working, in case this helps anyone else:
The text was updated successfully, but these errors were encountered: