FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
Herramientas | Buscar en Tema | Desplegado |
#1
|
|||
|
|||
Iconos XP en runtime
Muy buenas.
Estoy intentando cargar iconos xp (alpha blending) en un TImageList en tiempo de ejecución y se me ven muy mal. Lo que hago es leer la ruta del icono desde la base de datos y insertar el icono en el TImageList mediante un TIcon. ¿Que hago mal? ¿O es que no se puede? Lo digo porque si meto directamente los iconos en el TImageList desde el editor del Delphi se ven muy bien. Muchas gracias de antemano.
__________________
Código:
i := i + 1; // i++ |
#2
|
||||
|
||||
Hola
No te aseguro que funcione, pues no lo puedo probar ahora, pero quizás con:
mejore la apariencia. Saludos.
__________________
Lo importante no es llegar primero, sino saber llegar. Para que puedas llegar mejor lee la Guia de Estilo |
#3
|
|||
|
|||
Pues no funciona. Ni poniendo ImageType a itMasked, ni Masked a true... Ya te digo, si cargo los archivos uno a uno
(porque si le haces que carge más de 2 a la vez, se cargan mal también) en el imagelist antes de compilar, va bien, pero si lo hago en el "create" o en el "show" o donde sea, se ven sin el "alpha channel". Es una putada, porque no hay manera de cargar "dinamicamente" iconos en formato XP
__________________
Código:
i := i + 1; // i++ |
#4
|
|||
|
|||
Lo conseguí
Código:
procedure TfrmReNamer.ConvertTo32BitImageList(const ImageList: TImageList); const Mask: array[Boolean] of Longint = (0, ILC_MASK); var TemporyImageList: TImageList; begin // add to uses: commctrl, consts; if Assigned(ImageList) then begin TemporyImageList := TImageList.Create(nil); try TemporyImageList.Assign(ImageList); with ImageList do begin ImageList.Handle := ImageList_Create(Width, Height, ILC_COLOR32 or Mask[Masked], 0, AllocBy); if not ImageList.HandleAllocated then begin raise EInvalidOperation.Create(SInvalidImageList); end; end; ImageList.AddImages(TemporyImageList); finally TemporyImageList.Free; end; end; end;
__________________
Código:
i := i + 1; // i++ |
|
|
|