如何解决FMX 旋转位图闪烁
我想用 FMX 2D 绘制一个带有太阳的 TImage。这个太阳应该在油漆盒中旋转。因此使用以下程序:
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,(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,dest,false);
end;
finally
bmp.Free;
end;
end;
对于绘画,我使用空闲应用程序。帧速率约为每秒 1000。太阳很快就会显示出来(可能 1-2 秒),然后消失(1-3 秒)等等 = 闪烁。当 bmp.rotate 停用时,太阳将永久显示。 怎么了?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。