Got it, thanks. However, I ran into another issue.
Using the rich edit formatting to set my font to white, the text appears fine when running using the Windows theme. However, when switching to the Carbon theme, the text is a dark-grayish color - the font color in the rich edit formatting is ignored.
Code to create the text is like this:
procedure TestLayer;
var
WorkImage: TImageEnView;
LayerIndex: Integer;
begin
WorkImage := TImageEnView.Create(nil);
try
WorkImage.IO.LoadFromFile('C:\sample\image.png');
LayerIndex := WorkImage.LayersAdd(ielkText);
WorkImage.LayersCurrent := LayerIndex;
TIETextLayer(WorkImage.CurrentLayer).Width := WorkImage.IEBitmap.Width;
TIETextLayer(WorkImage.CurrentLayer).EnableFormatting := True;
TIETextLayer(WorkImage.CurrentLayer).RichText := '{\rtf1\ansi\ansicpg1252\deff0\nouicompat\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial;}}' +
'{\colortbl ;\red255\green255\blue255;} ' +
'{\*\generator Riched20 10.0.18362}\viewkind4\uc1' +
'\pard\sa200\sl276\slmult1\qr\cf1\fs24\lang9 Line 1\line Line 2\line A longer line 3 here\par' +
'}';
WorkImage.LayersMergeAll;
WorkImage.IO.SaveToFilePNG('C:\sample\overlay.png');
finally
WorkImage.Free;
end;
end;
How can I make the text color in the rich edit text consistent, regardless of the theme used? Thank you.