title: How to draw transparent bitmap from ImageList on TMenuItem?
body: <p>I need to draw a transparent bitmap on a TMenuItem. Despite trying for many hours with different methods I could not succeed:</p>
  
  <pre><code>var
    NewItem: TMenuItem;
    ThisBmp: TBitmap;
  begin
    NewItem := TMenuItem.Create(pmSendToCustomTool);
    NewItem.Caption := ThisCaption;
    NewItem.Bitmap.SetSize(16,16);
    NewItem.Bitmap.PixelFormat := pf32bit;
    NewItem.Bitmap.Transparent := True;
    NewItem.Bitmap.TransparentColor := clFuchsia;
    ThisBmp := TBitmap.Create;
    try
      ThisBmp.SetSize(16,16);
      ThisBmp.PixelFormat := pf32bit;
      ThisBmp.Transparent := True;
      ThisBmp.Canvas.Brush.Color := clFuchsia;
      ThisBmp.TransparentColor := clFuchsia; 
      MySystemImageList1.GetBitmap(AIndex, ThisBmp);
      CodeSite.Send('ThisBmp', ThisBmp);
      NewItem.Bitmap.Assign(ThisBmp);
      CodeSite.Send('NewItem.Bitmap', NewItem.Bitmap);
    finally
      ThisBmp.Free;
    end;
  </code></pre>
  
  <p>This is how <strong>ThisBmp</strong> looks in CodeSite after <code>GetBitmap</code>: <a href="https://i.stack.imgur.com/wXCUe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wXCUe.png" alt="enter image description here"></a></p>
  
  <p>And this how the resulting menu item looks: <a href="https://i.stack.imgur.com/Dn8uF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Dn8uF.png" alt="enter image description here"></a></p>