示例#1
0
        //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);
            }
        }
示例#2
0
        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);
        }
示例#3
0
 public Bitmap GetNonInstalledPin(int width, int height)
 {
     return(notInstalledPin ?? (notInstalledPin = SvgFactory.GetBitmap(context.Resources, Resource.Raw.pin_not_installed, width, height)));
 }
示例#4
0
 public Bitmap GetClosedPin(int width, int height)
 {
     return(closedPin ?? (closedPin = SvgFactory.GetBitmap(context.Resources, Resource.Raw.pin_locked, width, height)));
 }