创建旋转字体

procedure TForm1.FormPaint(Sender: TObject);
var
  //font: TFont;
  lf: TLogFont;
  I: Integer;
begin
  Canvas.Font.Name:= 'Arial';
  Canvas.Font.Size:= 24;
  Canvas.Font.Color:= clRed;
  //font:= TFont.Create;
  //font.Assign(Canvas.Font);
  GetObject(Canvas.Font.Handle, SizeOf(lf), @lf);
  lf.lfEscapement:= 0;
  lf.lfOrientation:= 0;
  lf.lfHeight:= 0;
  //SetBkMode(Canvas.Handle, TRANSPARENT);
  SetTextAlign(Canvas.Handle, TA_LEFT or TA_BOTTOM);
  for I := 0 to 9 do
  begin
    Canvas.Font.Handle:= CreateFontIndirect(lf);
   // Canvas.Font.Assign(font);
    Canvas.TextOut(Width div 2, Height div 2, '旋转特征文字');
    lf.lfEscapement:= lf.lfEscapement + 900;
    lf.lfOrientation:= lf.lfOrientation + 900;
    DeleteObject(Canvas.Font.Handle);
  end;
end;

你可能感兴趣的:(创建)