Версия для печати темы
Нажмите сюда для просмотра этой темы в оригинальном формате
Форум программистов > Delphi: Звук, графика и видео > Иконки WinXP и TImageList


Автор: TMoon 8.11.2003, 16:39
Каким образом использовать родные иконки WinXP в TImageList?
У меня возникает проблема с бекграундом.

Автор: Alex 9.11.2003, 14:17
Если картинки будут отображаться на TollBar, то установи свойство ImageList.BkColor:= clBtnFace
Если в на ListView и ему подобных то ImageList.BkColor:= clWindow
После чего добавь картинки.

Автор: TMoon 9.11.2003, 20:03
Не вышло sad.gif

BkColor = clBtnFace
AllocBy = 64
DrawingStyle = dsTransparent
Height = 32
ShareImages = True
Width = 32

Автор: Alex 10.11.2003, 07:09
Вышли иконку на alex-co@narod.ru

Автор: stab 10.11.2003, 07:41
похоже проблема в этом:

Цитата
Windows XP imagelists, which are collections of images used with certain controls such as list-view controls, support the use of 32-bit anti-aliased icons and bitmaps. Color values use 24 bits, and 8 bits are used as an alpha channel on the icons. To create an imagelist that can handle a 32 bits-per-pixel (bpp) image, call the ImageList_Create function passing in an ILC_COLOR32 flag.


а Delphi так делает:

Цитата

  FHandle := ImageList_Create(Width, Height, ILC_COLORDDB or Mask[Masked], AllocBy, AllocBy);


может я и ошибаюсь

Автор: TMoon 10.11.2003, 19:54
Самое интересное, что TImage замечательно показывает их с любым бекграундом.

Автор: Alex 12.11.2003, 07:24
Код
var
 ico: TIcon;
begin
 ImageList1.BkColor:= clBtnFace;
 ImageList2.BkColor:= clWindow;
 ico:= TIcon.Create;
 try
   ico.LoadFromFile('e:\Temp\Subscriptions.ico');
   ImageList1.AddIcon(ico);
   ico.LoadFromFile('e:\Temp\Subscriptions.ico');
   ImageList2.AddIcon(ico);
 finally
   ico.Free;
 end;
 with ListView1.Items.Add do begin
   Caption:= 'Test';
   ImageIndex:= 0;
 end;

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)