Fixed: canvas.filltext on android with fmx font is surrounded by block backgrounds

  

fixed see answer.

I found the posts regarding how to get text working with firemonkey. I have a graphics image and I want to put a label on it. I used .filltext and tested wtih win32 and everything worked great. But when I ran on the android the text is just blocks of white on the background. Obviously I need to set the brush that the font is using but it is not clear to me how. ( I have correctly sized the bitmap via the android scaling and my drawpolygon is working as expected)

Segment of the code is below.

Image1.bitmap.Canvas.BeginScene;
Image1.bitmap.canvas.Clear(TAlphaColors.Black);
Image1.bitmap.Canvas.Stroke.Thickness := 1;
Image1.bitmap.Canvas.Stroke.Color := TAlphaColorRec.Yellow;
Image1.bitmap.Canvas.DrawPolygon(FPoints2, 1); // polygon
// now testing text
Canvas.Font.Size := 40;
Image1.bitmap.mRect.Create(0, 0, (image1.width),( image1.height));
Image1.bitmap.Canvas.filltext(mRect, ‘Hello Text!’, false, 1,
[TFillTextFlag.RightToLeft],TTextAlign.Center, TTextAlign.Trailing);
Image1.bitmap.Canvas.EndScene;

Comments are closed.