Exemple #1
0
        public void UpdateTilePreview()
        {
            const int zoom = 2;

            Bitmap   preview = new Bitmap(Tile.Width * 2 * zoom, Tile.Height * 2 * zoom);
            Graphics g       = Graphics.FromImage(preview);
            Tile     tile    = Tileset[TileIndex];

            tile.Draw(g, 0, 0, zoom, zoom, TileBox.Color1, TileBox.Color2, TileBox.Color3, true);
            tile.Draw(g, 1, 0, zoom, zoom, TileBox.Color1, TileBox.Color2, TileBox.Color3, true);
            tile.Draw(g, 0, 1, zoom, zoom, TileBox.Color1, TileBox.Color2, TileBox.Color3, true);
            tile.Draw(g, 1, 1, zoom, zoom, TileBox.Color1, TileBox.Color2, TileBox.Color3, true);

            PreviewTileBox.BackColor = TileBox.BackColor;
            PreviewTileBox.Image     = preview;
            PreviewTileBox.Refresh();
        }
Exemple #2
0
        public void UpdateTilePreview()
        {
            const int zoom = 4;

            Bitmap   preview = new Bitmap(Tile.Width * zoom, Tile.Height * zoom);
            Graphics g       = Graphics.FromImage(preview);

            if (TileIndex < Tileset.Count)
            {
                Tileset[TileIndex].Draw(g, 0, 0, zoom, zoom,
                                        Palette[TileColor1], Palette[TileColor2], Palette[TileColor3], true);
            }

            PreviewTileBox.BackColor = Palette[Map.BackColor];
            PreviewTileBox.Image     = preview;
            PreviewTileBox.Refresh();
        }