this slowpoke moves

Draw Canvas Outline Fonts

procedure DrawTextOutline(const Canvas: TCanvas; const X, Y: Integer;
  const Text: string);
var
  OldBkMode: Integer;  // stores previous background mode
begin
  OldBkMode := SetBkMode(Canvas.Handle, TRANSPARENT);
  BeginPath(Canvas.Handle);
  Canvas.TextOut(X, Y, Text);
  EndPath(Canvas.Handle);
  StrokeAndFillPath(Canvas.Handle);
  SetBkMode(Canvas.Handle, OldBkMode);
end;

procedure TForm1.FormPaint(Sender: TObject);
const
  cText = 'Hello World!';
begin
  Canvas.Font.Name := 'Comic Sans MS';
  Canvas.Font.Style := [fsBold];
  Canvas.Font.Size := 48;
  // begin added code
  Canvas.Brush.Color := clWhite;
  Canvas.Pen.Style := psClear;
  DrawTextOutline(Canvas, 0, 0, cText);
  // end added code
  Canvas.Brush.Color := clSkyBlue;  // $F0CAA6
  Canvas.Brush.Style := bsDiagCross;
  Canvas.Pen.Color := clNavy;
  Canvas.Pen.Style := psDot;
  DrawTextOutline(Canvas, 0, 0, cText);
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate