LynnaLab.Room.GetImage C# (CSharp) Method

GetImage() public method

public GetImage ( ) : Bitmap
return System.Drawing.Bitmap
        public Bitmap GetImage()
        {
            if (cachedImage != null)
                return cachedImage;

            cachedImage = new Bitmap(width*16, height*16);
            Graphics g = Graphics.FromImage(cachedImage);

            for (int x=0; x<width; x++) {
                for (int y=0; y<height; y++) {
                    g.DrawImageUnscaled(area.GetTileImage(GetTile(x,y)), x*16, y*16);
                }
            }

            g.Dispose();

            return cachedImage;
        }

Usage Example

コード例 #1
0
        protected virtual Image GenerateTileImage(int x, int y)
        {
            Room   room = GetRoom(x, y);
            Bitmap img  = room.GetImage();

            return(img);
        }
All Usage Examples Of LynnaLab.Room::GetImage