I need to draw a transparent bitmap on a TMenuItem. Despite trying for many hours with different methods I could not succeed:
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;