всётаки версия dcef-r306.7z глючит работа со скриншотами. Ещё раз поставил dcef-r231.7z всё заработало. Использую код:
Код:
function CefGetBitmap(const browser: ICefBrowser; typ: TCefPaintElementType; Bitmap: TBitmap): Boolean;
var
w, h, i: Integer;
p, s: Pointer;
begin
browser.GetSize(typ, w, h);
Bitmap.PixelFormat := pf32bit;
{$IFDEF DELPHI12_UP}
Bitmap.SetSize(w, h);
{$ELSE}
Bitmap.Width := w;
Bitmap.Height := h;
{$ENDIF}
GetMem(p, h * w * 4);
try
Result := browser.GetImage(typ, w, h, p);
s := p;
for i := 0 to h - 1 do
begin
Move(s^, Bitmap.ScanLine[i]^, w*4);
Inc(Integer(s), w*4);
end;
finally
FreeMem(p);
end;
end;
Админ: Пользуемся тегами для оформления кода, иначе последуют санкции.
инструмент: WinXP + Delphi XE2