기본 콘텐츠로 건너뛰기

이미지 파일을 알파채널을 가진 BMP 파일로 변환

아래와 같이 간단하게 할 수 있습니다.
if (5 == args.Length)
{
    string sInutFilePath = args[0];
    string sOutputFilePath = args[1];
 
    int iRed = Convert.ToInt32(args[2]);
    int iGreen = Convert.ToInt32(args[3]);
    int iBlue = Convert.ToInt32(args[4]);
 
    Bitmap bmp = Image.FromFile(sInutFilePath) as Bitmap;
    bmp.MakeTransparent(Color.FromArgb(iRed, iGreen, iBlue));
    bmp.Save(sOutputFilePath, ImageFormat.Bmp);
}
else
{
    Console.WriteLine("Usage: png2bmp32     ");
}

댓글