問題: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(0, 0, b.Width, b.Height), RectF(0, 0, b.Width, b.Height), 1, 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