unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus;
type
TForm1 =
class(TForm)
PopupMenu1: TPopupMenu;
aa1: TMenuItem;
procedure aa1DrawItem(Sender: TObject; ACanvas: TCanvas; ARect: TRect;
Selected: Boolean);
procedure aa1MeasureItem(Sender: TObject; ACanvas: TCanvas;
var Width,
Height: Integer);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.aa1DrawItem(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; Selected: Boolean);
begin
ACanvas.Draw(0,0,Application.Icon);
end;
procedure TForm1.aa1MeasureItem(Sender: TObject; ACanvas: TCanvas;
var Width, Height: Integer);
begin
Width := Application.Icon.Width;
Height := Application.Icon.Height;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
PopupMenu1.OwnerDraw := True;
PopupMenu := PopupMenu1;
end;
end.