Einzelnen Beitrag anzeigen

thomas2009
(Gast)

n/a Beiträge
 
#1

RichEdit Text mit schatten

  Alt 30. Mär 2011, 21:18
Hi

mit diesem Code kann ich den Text in RichEdit mit einem Schatten-Effekt zeichnen
Das Problem, alle Linien von RichEdit kommen in eine Linie

Gibt es eine Andere Funktion für Richedit? Der Code ist normalerweise für eine String gedacht und nicht für TString
Delphi-Quellcode:
var
   lf: LOGFONT; // Windows native font structure
  // text: string;
begin
   Canvas.Brush.Style := bsClear; // set the brush style to transparent
   FillChar(lf, SizeOf(lf), Byte(0)) ;
   lf.lfHeight := 100;
   lf.lfFaceName := 'Arial';
   Canvas.Font.Handle := CreateFontIndirect(lf) ;
   Canvas.Font.Color := clBlack;
   //text := txtText.Text;
   Canvas.TextOut(20, 100, RichEdit1.Lines.Text) ; // shadow in black
   //Canvas.Font.Color := clGray;
   Canvas.Font.Color := clBlue;
//Canvas.TextOut(19, 99, Edit1.Text) ; // // text in gray 1pxl left and up
   Canvas.TextOut(19, 99, RichEdit1.Lines.Text) ;
end;
  Mit Zitat antworten Zitat