title: Why is my icon ugly on the tray bar with TTrayIcon?
body: <p>I recently discovered the TTrayIcon component in Delphi 2007. The code used is pretty straightforward.</p>
  
  <pre><code>procedure TForm1.FormCreate(Sender: TObject);
  begin
   AppTrayIcon := TTrayIcon.Create(nil);
   AppTrayIcon.OnDblClick := OnAppTrayIconDblClick;
   Application.OnMinimize := OnApplicationMinimize;
   Application.OnRestore := OnApplicationRestore;
  end;
  
  procedure TForm1.OnApplicationRestore(Sender: TObject);
  begin
   AppTrayIcon.Visible := False;
   ShowWindow(Application.Handle, SW_SHOW);
   Application.BringToFront;
  end;
  
  procedure TForm1.OnApplicationMinimize(Sender: TObject);
  begin
   AppTrayIcon.Visible := True;
   ShowWindow(Application.Handle, SW_HIDE);
  end;
  
  procedure TForm1.OnAppTrayIconDblClick(Sender: TObject);
  begin
   Application.Restore;
  end;
  </code></pre>
  
  <p>Since there is no icon assigned, Delphi uses Application.Icon, which is that icon: <a href="http://artbyloveland.com/icon.ico" rel="nofollow noreferrer">http://artbyloveland.com/icon.ico</a> This icon includes the following sizes: 64x64, 48x48, 32x32, 24x24 and 16x16.</p>
  
  <p>Now, on my Windows Vista, everything fine.</p>
  
  <p>On a non-themed Windows like Windows Server 2003, the result is all screwed-up:</p>
  
  <p><img src="https://image.noelshack.com/fichiers/2012/48/1354109537-sc.png" alt="Screwed-up icon"></p>
  
  <p><strong>EDIT:</strong>
  At first, I thought it was because of the alpha channel. So I tried to make a version of the ico file without the use of alpha channel. I also tried GreenFish Icon Editor as suggested by Ken; I selected every color depth and every size available. In both cases, the end result is better. However, there is a black stroke that doesn't exist at all in the ico file.</p>
  
  <p><img src="https://image.noelshack.com/fichiers/2012/48/1354121023-sans-titre.png" alt="Screwed-up icon 2"></p>