This is because GDI applies some anti-aliasing when drawing text to make the text look better. This causes some background pixels outside the drawn text to be red / reddish next to the text. The next time you draw text, if you do not clear the background, smoothing causes these reddish pixels to become redder.
You either clear the background like Arioch ' specified in it, or if you really need to make the text transparent and multiple times, you can turn off anti-aliasing.
TOndrej provided a nice feature in this answer to indicate the quality of the text output. Using it, the code becomes:
begin Form1.Canvas.Brush.Style:=bsClear; Form1.Canvas.Font.Color:=clRed; Form1.Canvas.Font.Name:='Times new Roman'; Form1.Canvas.Font.Style:=[fsBold]; Form1.Canvas.Font.Size:=12; SetFontQuality(Form1.Canvas.Font, NONANTIALIASED_QUALITY); // <-- Form1.Canvas.TextOut(50,50,'www.stackoverflow.com'); end;
source share