Thema: Delphi WinXP Icons 32 Bit

Einzelnen Beitrag anzeigen

Benutzerbild von Mystic
Mystic

Registriert seit: 18. Okt 2003
Ort: Flerzheim
420 Beiträge
 
Turbo Delphi für Win32
 
#20

Re: WinXP Icons 32 Bit

  Alt 16. Mai 2006, 17:59
Hab was gefunden:

http://qc.borland.com/qc/wc/qcmain.aspx?d=4653
Run the following procedure *before* adding any icons to the image list (add Consts and CommCtrl units to the uses clause; also add XP manifest to your project):
Delphi-Quellcode:
procedure ConvertTo32BitImageList(const ImageList: TImageList);
const
  Mask: array[Boolean] of Longint = (0, ILC_MASK);
var
  TempList: TImageList;
begin
  if Assigned(ImageList) then
  begin
    TempList := TImageList.Create(nil);
    try
      TempList.Assign(ImageList);
      with ImageList do
      begin
        Handle := ImageList_Create(
          Width, Height, ILC_COLOR32 or Mask[Masked], 0, AllocBy);

        if not HandleAllocated then
          raise EInvalidOperation.Create(SInvalidImageList);
      end;

      Imagelist.AddImages(TempList);
    finally
      FreeAndNil(TempList);
    end;
  end;
end;
Jan Steffens
Der Fachwortgenerator - 100% Schwachsinn --- Der UPnP Router Manager - Kommentare erwünscht!
  Mit Zitat antworten Zitat