PowerArgs.Cli.ConsoleBitmap.GetPixel C# (CSharp) 메소드

GetPixel() 공개 메소드

public GetPixel ( int x, int y ) : ConsolePixel
x int
y int
리턴 ConsolePixel
        public ConsolePixel GetPixel(int x, int y)
        {
            return pixels[x][y];
        }

Usage Example

        private ConsoleBitmapRawFrame GetRawFrame(ConsoleBitmap bitmap)
        {
            var rawFrame = new ConsoleBitmapRawFrame();

            rawFrame.Pixels = new ConsoleCharacter[bitmap.Width][];
            for (int x = 0; x < bitmap.Width; x++)
            {
                rawFrame.Pixels[x] = new ConsoleCharacter[bitmap.Height];
                for (int y = 0; y < bitmap.Height; y++)
                {
                    var pixelValue = bitmap.GetPixel(x, y).Value.HasValue ? bitmap.GetPixel(x, y).Value.Value : new ConsoleCharacter(' ');
                    rawFrame.Pixels[x][y] = pixelValue;
                }
            }
            return(rawFrame);
        }
All Usage Examples Of PowerArgs.Cli.ConsoleBitmap::GetPixel