PowerArgs.Cli.ConsoleBitmap.Resize C# (CSharp) Method

Resize() public method

public Resize ( int w, int h ) : void
w int
h int
return void
        public void Resize(int w, int h)
        {
            var newPixels = new ConsolePixel[w][];
            for (int x = 0; x < w; x++)
            {
                newPixels[x] = new ConsolePixel[h];
                for (int y = 0; y < newPixels[x].Length; y++)
                {
                    if (IsInBounds(x, y))
                    {
                        newPixels[x][y] = pixels[x][y];
                    }
                    else
                    {
                        newPixels[x][y] = new ConsolePixel() { Value = Background };
                    }
                }
            }

            pixels = newPixels;
            this.Size = new Size(w, h);
            this.Scope(Bounds);
            this.Invalidate();
        }