Ejemplo n.º 1
0
        public void MergeBitmaps(string bitmapText)
        {
            foreach (string singleBitmap in bitmapText.Split(new string[] { "00001" + Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (IsBitmapSymbol(singleBitmap))
                {
                    BitmapSymbol bs = new BitmapSymbol(singleBitmap, ColorTables["DAY_BRIGHT"]);
                        //TODO: not nice to assume this ColorTable
                    try
                    {
                        if (bs.IsValid())
                        {
                            SymbolBitmaps.Add(bs.Code, bs);
                        }
                        else
                        {
                            Debug.Print("Bitmap symbol {0} is not valid and can't be merged.", bs.Code);
                        }
                    }
                    catch (Exception ex)
                    {
                        Debug.Print(
                            "Bitmap symbol {0} can't be loaded with following message: '{1}', if not invalid, assuming already exists and replacing",
                            bs.Code, ex.Message);
                        if (bs.Code != null)
                        {
                            this.SymbolBitmaps[bs.Code] = bs;
                        }
                    }
                    if (bs.ObjectId >= NextId)
                    {
                        NextId = bs.ObjectId + 1;
                    }
                }

                if (IsBitmapPattern(singleBitmap))
                {
                    BitmapPattern bp = new BitmapPattern(singleBitmap, ColorTables["DAY_BRIGHT"]);
                        //TODO: not nice to assume this ColorTable
                    try
                    {
                        if (bp.IsValid())
                        {
                            PatternBitmaps.Add(bp.Code, bp);
                        }
                        else
                        {
                            Debug.Print("Bitmap symbol {0} is not valid and can't be merged.", bp.Code);
                        }
                    }
                    catch (Exception ex)
                    {
                        Debug.Print(
                            "Bitmap symbol {0} can't be loaded with following message: '{1}', if not invalid, assuming already exists and replacing",
                            bp.Code, ex.Message);
                        if (bp.Code != null)
                        {
                            this.PatternBitmaps[bp.Code] = bp;
                        }
                    }
                    if (bp.ObjectId >= NextId)
                    {
                        NextId = bp.ObjectId + 1;
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public BitmapPattern Clone()
 {
     BitmapPattern bs = new BitmapPattern(this.ToString(), this.ColorTable);
     return bs;
 }
Ejemplo n.º 3
0
        public BitmapPattern Clone()
        {
            BitmapPattern bs = new BitmapPattern(this.ToString(), this.ColorTable);

            return(bs);
        }