[改善] dcef3 for Firemonkey 浏览器控件,拉动窗体大小会闪烁的问题

问题:dcef3 for Firemonkey 浏览器控件,拉动窗体大小会闪烁的问题

修改源码:ceffmx.pas

找到 procedure TCustomChromiumFMX.Resize;

修改如下:

procedure TCustomChromiumFMX.Resize;
var
brws: ICefBrowser;
b: TBitmap;
begin
inherited;
if not (csDesigning in ComponentState) then
begin
brws := FBrowser;
if (brws <> nil) then
begin
if FBuffer = nil then
FBuffer := TBitmap.Create(Trunc(Width), Trunc(Height)) else
begin
b := TBitmap.Create;
b.Assign(FBuffer);
FBuffer.SetSize(Trunc(Width), Trunc(Height));
FBuffer.Canvas.BeginScene;
FBuffer.Canvas.DrawBitmap(B, RectF(, , b.Width, b.Height), RectF(, , b.Width, b.Height), , True);
FBuffer.Canvas.EndScene;
b.Free;
end;
brws.Host.WasResized;
end;
end;
end;

Delphi Chromium Embeded 3:https://github.com/hgourvest/dcef3

注:dcef3 FMX 用 Bitmap 处理,效能不如 VCL 的好,还是建议使用 VCL

上一篇:TIP协议


下一篇:MFC控件GDI编程