/// <summary>
/// 이미지를 투명도에 따라서 바꿔줍니다.
/// </summary>
/// <param name="Bitmap">The Bitmap to Convert to Transparent.</param>
/// <returns>A Transparent Image.</returns>
public Bitmap Transparent(Bitmap bitmap, int Alpha = 255)
{
//Declare myBitmap as a new Bitmap with the same Width & Height
Bitmap myBitmap = new Bitmap(bitmap.Width, bitmap.Height);
for (int i = 0; i < bitmap.Width; i++)
{
for (int x = 0; x < bitmap.Height; x++)
{
//Get the Pixel
Color BitmapColor = bitmap.GetPixel(i, x);
if (BitmapColor.A <= 1)
continue;
//Declare myColor as a Grayscale Color
Color myColor = Color.FromArgb(Alpha, BitmapColor.R, BitmapColor.G, BitmapColor.B);
//Set the Grayscale Pixel
myBitmap.SetPixel(i, x, myColor);
}
}
return myBitmap;
}
- 대표 전화 : 02) 2061 - 0753 - Fax : 02) 2061 - 0759 - Skype : devzone24
- 주소 : 서울특별시 양천구 목1동 923-14. 현대드림타워 1024호
- 기술 문의: 02) 2061-1259 김민석 기술이사
댓글 없음:
댓글 쓰기