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

#region 비트맵 구하기 - GetBitmap(sourceImage)

/// <summary>
/// 비트맵 구하기
/// </summary>
/// <param name="sourceImage">소스 이미지</param>
/// <returns>비트맵</returns>
public Bitmap GetBitmap(Image sourceImage)
{
    Bitmap targetBitmap = new Bitmap
    (
        sourceImage.Width,
        sourceImage.Height,
        PixelFormat.Format32bppArgb
    );

    using(Graphics graphics = Graphics.FromImage(targetBitmap))
    {
        graphics.DrawImage
        (
            sourceImage,
            new Rectangle(0, 0, targetBitmap.Width, targetBitmap.Height),
            new Rectangle(0, 0, targetBitmap.Width, targetBitmap.Height),
            GraphicsUnit.Pixel
        );

        graphics.Flush();
    }

    return targetBitmap;
}

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

댓글을 달아 주세요