Пример #1
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            SpritistData data = GetItem(position);


            if (convertView == null)
            {
                LayoutInflater inflater = LayoutInflater.From(Context);
                convertView = inflater.Inflate(Resource.Layout.main_list_object, parent, false);
            }

            ImageView imageView = convertView.FindViewById <ImageView>(Resource.Id.main_list_object_image);
            TextView  textView  = convertView.FindViewById <TextView>(Resource.Id.main_list_object_text);

            byte[]               decoded        = Base64.Decode(data.ImageData, Base64Flags.Default);
            Bitmap               bitmap         = BitmapFactory.DecodeByteArray(decoded, 0, decoded.Length);
            BitmapDrawable       bitmapDrawable = new BitmapDrawable(bitmap);
            AliasDrawableWrapper wr             = new AliasDrawableWrapper(bitmapDrawable);

            // imageView.SetImageBitmap(bitmap);
            imageView.SetImageDrawable(wr);

            textView.Text = data.SpriteName;

            return(convertView);
            // return base.GetView(position, convertView, parent);
        }
Пример #2
0
        protected void SetUpImage(ref Canvas canvas, ref BitmapDrawable drawable, ref Bitmap bitmap, ImageView view, int w, int h)
        {
            bitmap   = Bitmap.CreateBitmap(w, h, Bitmap.Config.Argb8888);
            drawable = new BitmapDrawable(bitmap);
            canvas   = new Canvas(bitmap);
            DrawableWrapper wr = new AliasDrawableWrapper(drawable);

            view.SetImageDrawable(wr);
        }
Пример #3
0
        private void SetupSideImageViews(int id, Bitmap srcBitmap)
        {
            ImageView       view     = FindViewById <ImageView>(id);
            BitmapDrawable  drawable = new BitmapDrawable(srcBitmap);
            DrawableWrapper wr       = new AliasDrawableWrapper(drawable);

            view.SetImageDrawable(wr);
            tiledViews.Add(view);
        }