//Load svg string from url private async Task <Bitmap> LoadSvgString(string svgUrl) { using (var client = new HttpClient()) { client.DefaultRequestHeaders.Add("x-crowdscores-api-key", "91e57182c3954dc68a2e184c30271b4a"); var result = await client.GetAsync(svgUrl); var svgString = await result.Content.ReadAsStringAsync(); var image = SvgFactory.GetBitmap(new StringReader(svgString), 50, 50); return(image); } }
void LoadImageTest(int rawID) { foreach (var drawableID in drawableViewIds) { var drawable = SvgFactory.GetDrawable(Resources, rawID); var v = FindViewById <ImageView> (drawableID); v.SetImageDrawable(drawable); } var bitmap1 = SvgFactory.GetBitmap(Resources, rawID, width: 40, height: 69); var bitmap2 = SvgFactory.GetBitmap(Resources, rawID, width: 98, height: 98); var bitmap3 = SvgFactory.GetBitmap(Resources, rawID, width: 47, height: 32); FindViewById <ImageView> (Resource.Id.bitmap1).SetImageBitmap(bitmap1); FindViewById <ImageView> (Resource.Id.bitmap2).SetImageBitmap(bitmap2); FindViewById <ImageView> (Resource.Id.bitmap3).SetImageBitmap(bitmap3); }
public Bitmap GetNonInstalledPin(int width, int height) { return(notInstalledPin ?? (notInstalledPin = SvgFactory.GetBitmap(context.Resources, Resource.Raw.pin_not_installed, width, height))); }
public Bitmap GetClosedPin(int width, int height) { return(closedPin ?? (closedPin = SvgFactory.GetBitmap(context.Resources, Resource.Raw.pin_locked, width, height))); }