public static void SetImageString(this RoundedImageView imageview, string pathImage, int decodePixelWidth, int decodePixelHeight)
        {
            var file = new File(pathImage);
            var opt  = new BitmapFactory.Options();

            opt.InJustDecodeBounds = true;
            BitmapFactory.DecodeFile(file.AbsolutePath, opt);
            opt.InSampleSize       = CalculateInSampleSize(opt, decodePixelWidth, decodePixelHeight);
            opt.InJustDecodeBounds = false;
            Bitmap myBitmap = BitmapFactory.DecodeFile(file.AbsolutePath, opt);

            imageview.SetImageBitmap(myBitmap);
        }
Exemple #2
0
            public override View GetView(int position, View convertView, ViewGroup parent)
            {
                ViewGroup view;

                if (convertView == null)
                {
                    if (exampleType == ExampleType.SelectCorners)
                    {
                        view = (ViewGroup)mInflater.Inflate(Resource.Layout.RoundedItemSelect, parent, false);
                    }
                    else
                    {
                        view = (ViewGroup)mInflater.Inflate(Resource.Layout.RoundedItem, parent, false);
                    }
                }
                else
                {
                    view = (ViewGroup)convertView;
                }

                StreamItem item = GetItem(position);

                RoundedImageView iv = (view.FindViewById <RoundedImageView>(Resource.Id.imageView1));

                iv.IsOval = exampleType == ExampleType.Oval;
                iv.SetImageBitmap(item.Bitmap);
                iv.SetScaleType(item.ScaleType);
                iv.TileModeX = item.TileMode;
                iv.TileModeY = item.TileMode;

                view.FindViewById <TextView>(Resource.Id.textView1).Text = item.Line1;
                view.FindViewById <TextView>(Resource.Id.textView2).Text = item.Line2;
                view.FindViewById <TextView>(Resource.Id.textView3).Text = item.ScaleType.ToString();

                return(view);
            }