Windows XP에서 아이콘을 만드는 데 문제가 있습니다.Windows에서 비트 맵 아이콘 만들기 xp
void SaveAsIcon(Bitmap SourceBitmap, string FilePath)
{
FileStream FS = new FileStream(FilePath, FileMode.Create);
// ICO header
FS.WriteByte(0); FS.WriteByte(0);
FS.WriteByte(1); FS.WriteByte(0);
FS.WriteByte(1); FS.WriteByte(0);
// Image size
FS.WriteByte((byte)SourceBitmap.Width);
FS.WriteByte((byte)SourceBitmap.Height);
// Palette
FS.WriteByte(0);
// Reserved
FS.WriteByte(0);
// Number of color planes
FS.WriteByte(0); FS.WriteByte(0);
// Bits per pixel
FS.WriteByte(32); FS.WriteByte(0);
// Data size, will be written after the data
FS.WriteByte(0);
FS.WriteByte(0);
FS.WriteByte(0);
FS.WriteByte(0);
// Offset to image data, fixed at 22
FS.WriteByte(22);
FS.WriteByte(0);
FS.WriteByte(0);
FS.WriteByte(0);
// Writing actual data
SourceBitmap.Save(FS, ImageFormat.Png);
// Getting data length (file length minus header)
long Len = FS.Length - 22;
// Write it in the correct place
FS.Seek(14, SeekOrigin.Begin);
FS.WriteByte((byte)Len);
FS.WriteByte((byte)(Len >> 8));
FS.Close();
}
비스타 이상에서 작품을 좋아 : 다음은 내 코드입니다.
Windows XP에서 비트 맵에서 아이콘을 만들려면 어떻게해야합니까? Win32에서 리소스를 생성
오류 : 오류 읽기 아이콘
비스타에서, 7, 작동 팔 난이 오류가 위의
는 내가 방법을 사용 아이콘을하려고하면.
어디서이 오류가 발생합니까? 나는 아이콘이 ico 파일 일 필요가 있다고 생각했다. – Sayse
나는 C#에서 동적 컴파일 중에이 오류가 발생한다. CompilerParameters cp = 새로운 CompilerParameters(); cp.CompilerOptions = "/ optimize/warn : 4/target : winexe /win32icon:icon.ico"; – Yozer