FMX rotate bitmap flickers

  

I want to draw with FMX 2D a TImage, loaded with a sun. This sun should be rotated in a paintbox. Therefor the following procedure is used:
var src, dest: TRectF;
bmp: TBitmap;
myAngle: single;
begin
bmp := TBitmap.Create(round(Right-Left), round(Bottom-Top));
try
if bmp.Canvas.BeginScene(nil) then
begin
src := RectF(PatternIndex * PatternWidth, 0, (PatternIndex + 1) * PatternWidth, PatternHeight);
dest := RectF(Left, Top, Right, Bottom);
bmp.Canvas.DrawBitmap(figbig[ImageIndex].Bitmap, src, bmp.BoundsF, 1, false);
bmp.Rotate(myAngle); // <– if I deactivate the rotate then the bitmap is shown the right way
bmp.Canvas.EndScene;
myCanvas.DrawBitmap(bmp, bmp.BoundsF, dest, 1, false);
end;
finally
bmp.Free;
end;
end;

For the painting i use application idle. The frame rate is about 1000 per sec. The sun is shown very shortly (perhaps 1-2 seconds), disappears (1-3 seconds) and so on = flickering. When the bmp.rotate is deactivated the sun is shown permanent.
What is wrong?

Comments are closed.