procedure TForm1.SetCanvasFont(ACanvas: TCanvas;
sFontName: String;
iFontSize, iFontColor: Integer;
fsStyle: TFontStyles);
begin
with ACanvas.Font do
begin
Name := sFontName;
Size := iFontSize;
Color := iFontColor;
Style := fsStyle;
end;
end;
//菜单自画
procedure TForm1.gsdagf1DrawItem(Sender: TObject;
ACanvas: TCanvas;
ARect: TRect;
Selected: Boolean);
begin
SetCanvasFont(ACanvas, '宋体', 11, clRed, [fsBold]);
ACanvas.TextOut(ARect.Left, ARect.Top, (Sender as TMenuItem).Caption);
end;