Exemple #1
0
        public MapControl3()
        {
            m_drawingCache = new DrawingCache();
            m_symbolDrawingCache = new SymbolDrawingCache(m_drawingCache);
            m_symbolBitmapCache = new SymbolBitmapCache(m_symbolDrawingCache, m_tileSize);

            m_map = new Map(512, 512);
            for (int y = 0; y < m_map.Height; ++y)
            {
                for (int x = 0; x < m_map.Width; ++x)
                {
                    m_map.MapArray[y, x] = (x + (y % 2)) % 2 == 0 ? (byte)50 : (byte)255;
                }
            }
        }
Exemple #2
0
        public MapControl4()
        {
            m_drawingCache = new DrawingCache();
            m_symbolDrawingCache = new SymbolDrawingCache(m_drawingCache);
            m_symbolBitmapCache = new SymbolBitmapCache(m_symbolDrawingCache, m_tileSize);

            m_map = new Map(512, 512);
            for (int y = 0; y < m_map.Height; ++y)
            {
                for (int x = 0; x < m_map.Width; ++x)
                {
                    m_map.MapArray[y, x] = (x + (y % 2)) % 2 == 0 ? (byte)50 : (byte)255;
                }
            }

            m_bmpArray = new BitmapSource[10];
            for (int i = 0; i < 10; ++i)
                m_bmpArray[i] = m_symbolBitmapCache.GetBitmap((SymbolID)i, Colors.Black, false);

            m_mcd2d = new TileControlD2D();
            m_mcd2d.SetSymbolBitmaps(m_bmpArray, m_tileSize);
            AddChild(m_mcd2d);
        }