[改善] 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(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

posted @ 2017-02-10 12:50  龟山Aone  阅读(1278)  评论(0编辑  收藏  举报