AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Icons ohne Schwarzen Rand

Ein Thema von neolithos · begonnen am 16. Mär 2004 · letzter Beitrag vom 17. Mär 2004
 
NicoDE
(Gast)

n/a Beiträge
 
#5

Re: Icons ohne Schwarzen Rand

  Alt 16. Mär 2004, 20:59
Zitat von neolithos:
Nur mit ImageList_Draw habert es noch! Weis jemand was?
Setz die Hintergrundfarbe der ImageList auf die Farbe des ListView.

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  IconCount: Integer;
  IconIndex: Integer;
  LargeIcon: HICON;
  IconObject: TIcon;
  ListItem: TListItem;
begin
  ListView1.Clear();
  ImageList1.Clear();
  ImageList1.BkColor := ListView1.Color; // <- wichtig :)
  IconCount := ExtractIconEx(shell32, -1, HICON(nil^), HICON(nil^), 0);
  if IconCount > 0 then
  begin
    ImageList1.Width := GetSystemMetrics(SM_CXICON);
    ImageList1.Height := GetSystemMetrics(SM_CYICON);
    for IconIndex := 0 to IconCount - 1 do
    begin
      LargeIcon := 0;
      if (ExtractIconEx(shell32, IconIndex, LargeIcon, HICON(nil^), 1) > 0) and
        (LargeIcon <> 0) then
      try
        IconObject := TIcon.Create();
        try
          IconObject.Handle := LargeIcon;
          ImageList1.AddIcon(IconObject);
          ListItem := ListView1.Items.Add();
          ListItem.Caption := '#' + IntToStr(IconIndex);
          ListItem.ImageIndex := IconIndex;
        finally
          IconObject.Free();
        end;
      finally
        DestroyIcon(LargeIcon);
      end;
    end;
  end;
end;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:50 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz