1
0
mirror of https://github.com/salvadordf/CEF4Delphi.git synced 2025-06-12 22:07:39 +02:00

Update to CEF 3.3202.1690.gcd6b88f

- Update to CEF 3.3202.1690.gcd6b88f
- Bug fix #71
- Added the TCEFWorkScheduler class to handle the cef_do_message_loop_work calls when you use an external message pump.
- Added 2 demos using the "external message pump" mode.
- Added a TakeSnapshot function to the TChromium and TCEFWindowParent to take snapshots in non-OSR mode.
This commit is contained in:
Salvador Díaz Fau
2017-12-05 10:02:07 +01:00
parent 24f5a70f4b
commit 751fe924b7
35 changed files with 4776 additions and 258 deletions

View File

@ -48,9 +48,9 @@ interface
uses
{$IFDEF DELPHI16_UP}
WinApi.Windows, WinApi.Messages, System.Classes, Vcl.Controls,
WinApi.Windows, WinApi.Messages, System.Classes, Vcl.Controls, Vcl.Graphics,
{$ELSE}
Windows, Messages, Classes, Controls,
Windows, Messages, Classes, Controls, Graphics,
{$ENDIF}
uCEFTypes, uCEFInterfaces;
@ -64,6 +64,8 @@ type
public
procedure UpdateSize;
function TakeSnapshot(var aBitmap : TBitmap) : boolean;
property ChildWindowHandle : THandle read GetChildWindowHandle;
published
@ -144,4 +146,33 @@ begin
end;
end;
function TCEFWindowParent.TakeSnapshot(var aBitmap : TBitmap) : boolean;
var
TempHWND : HWND;
TempDC : HDC;
TempRect : TRect;
TempWidth : Integer;
TempHeight : Integer;
begin
Result := False;
TempHWND := ChildWindowHandle;
if (TempHWND <> 0) then
begin
Winapi.Windows.GetClientRect(TempHWND, TempRect);
TempDC := GetDC(TempHWND);
TempWidth := TempRect.Right - TempRect.Left;
TempHeight := TempRect.Bottom - TempRect.Top;
aBitmap := TBitmap.Create;
aBitmap.Height := TempHeight;
aBitmap.Width := TempWidth;
Result := BitBlt(aBitmap.Canvas.Handle, 0, 0, TempWidth, TempHeight,
TempDC, 0, 0, SRCCOPY);
ReleaseDC(TempHWND, TempDC);
end;
end;
end.