Hi
da man in den Delph-Menüs leider nur BitMaps benutzen kann, wollt ich einen kleinen konverter schreiben der Icon´s in BitMaps kovertiert und umgekehrt.
Das von Icon nach BitMap klappt bereits.
Nur andersrum habe ich das Problem, das das Icon invertiert ist, also immer so als ob es markiert wäre, wenn ich es markiere ist es so wie ichs will.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31:
| begin pathload := LWL+DNL+'.bmp'; pathsave := LWS+DNS+'.ico'; IconX := GetSystemMetrics(SM_CXICON); IconY := GetSystemMetrics(SM_CYICON); Icon := TIcon.Create; Bitmap := TBitmap.Create; Mask := TBitmap.Create; BitMap.Width:=IconX; BitMap.Height:=IconY; Mask.Width:=IconX; Mask.Height:=IconY; Mask.Monochrome:=true; Bitmap.LoadFromFile(pathload); Mask.LoadFromFile(pathload);
with iconinfo do begin fIcon:=true; xHotspot:=0; yHotspot:=0; hbmMask:=Mask.Handle; hbmColor:=BitMap.Handle; end;
Icon.Handle:=CreateIconIndirect(IconInfo); Icon.SaveToFile(pathsave); Icon.Free; Bitmap.Free; Mask.Free;
end; |