첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170
using System.Drawing;

#region 비트맵 배열 구하기 - GetBitmapArray(sourceBitmap, redArray, greenArray, blueArray)

/// <summary>
/// 비트맵 배열 구하기
/// </summary>
/// <param name="sourceBitmap">소스 비트맵</param>
/// <param name="redArray">빨강 배열</param>
/// <param name="greenArray">녹색 배열</param>
/// <param name="blueArray">파랑 배열</param>
public void GetBitmapArray(Bitmap sourceBitmap, ref int[,] redArray, ref int[,] greenArray, ref int[,] blueArray)
{
    Color  color;

    redArray   = new int[sourceBitmap.Height, sourceBitmap.Width];
    greenArray = new int[sourceBitmap.Height, sourceBitmap.Width];
    blueArray  = new int[sourceBitmap.Height, sourceBitmap.Width];

    for(int y = 0; y < sourceBitmap.Height; y++)
    {
        for(int x = 0; x < sourceBitmap.Width; x++)
        {
            color = sourceBitmap.GetPixel(x, y);

            redArray  [y, x] = color.R;
            greenArray[y, x] = color.G;
            blueArray [y, x] = color.B;
        }
    }
}

#endregion
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요