示例#1
0
        public override ImageReference GetBackground(int row, int column)
        {
            var station = stations [row];

            return(station.Background != null?ImageReference.ForBitmap(station.Background)
                       : (row % 2) == 0 ? background : background2);
        }
示例#2
0
            public override ImageReference GetBackground(int row, int col)
            {
                var            pt     = new Point(row, col);
                ImageReference imgRef = null;

                if (mBackgrounds.ContainsKey(pt))
                {
                    imgRef = mBackgrounds [pt];
                }
                if (imgRef == null)
                {
                    var bm = Bitmap.CreateBitmap(200, 200, Bitmap.Config.Argb8888);
                    var c  = new Canvas(bm);
                    var p  = new Paint();
                    c.DrawRect(0, 0, 200, 200, p);
                    p.AntiAlias = true;
                    p.SetTypeface(Typeface.Default);
                    p.TextSize = 64;
                    p.Color    = Color.LightGray;
                    c.DrawText(col + "-" + row, 20, 100, p);
                    imgRef = ImageReference.ForBitmap(bm);
                    mBackgrounds.Add(pt, imgRef);
                }
                return(imgRef);
            }