Frequently Asked Component Specific Questions
Options |
Display all FAQ items |
Displaying items 1 to 1 of 1, page 1 of 1
<< previous next >>
TAdvRichEditor
How to use a watermark
How to use a watermark
It is easy to use a watermark for TAdvRichEditor. To do this, simply implement the OnDrawBackground event and in this event, you can use the canvas to draw whatever watermark you may want for the TAdvRichEditor.
Example:
var png: TPNGImage; procedure TForm4.FormCreate(Sender: TObject); begin png := TPNGImage.Create; png.LoadFromFile(''e:\tms\temp\watermark-news.png''); end; procedure TForm4.FormClose(Sender: TObject; var Action: TCloseAction); begin png.Free; end; procedure TForm4.AdvRichEditor1DrawBackground(Sender: TObject; ACanvas: TCanvas; ARect: TRect); begin ACanvas.Draw(0,0,png); end;