Ejemplo n.º 1
0
        /// <summary>
        /// Get the bitmap of a tile
        /// </summary>
        /// <param name="ti">Tile index</param>
        /// <returns>Tile bitmap</returns>
        public Bitmap GetTileBitmap(TileIndex ti)
        {
            RgbTile tl = CurrentFrame.GetRgbTile(ti);

            if (tl != null)
            {
                return(tl.ToImage());
            }
            return(null);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Write the Rgb data of this surface to a bitmap
        /// </summary>
        /// <returns>Bitmap</returns>
        public Bitmap RgbToImage()
        {
            Bitmap     surfImg = new Bitmap(this.Width, this.Height);
            Graphics   gSurf   = Graphics.FromImage(surfImg);
            SolidBrush bgBrush = new SolidBrush(Color.FromArgb(0, Color.Black));

            gSurf.FillRectangle(bgBrush, new Rectangle(0, 0, surfImg.Width, surfImg.Height));
            foreach (TileIndex index in this.rgbTileDic.Keys)
            {
                RgbTile rgbT = rgbTileDic[index];
                gSurf.DrawImage(rgbT.ToImage(), index.X * RdpegfxTileUtils.TileSize, index.Y * RdpegfxTileUtils.TileSize);
            }
            gSurf.Dispose();
            return(surfImg);
        }