You've already forked CEF4Delphi
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:
@ -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.
|
||||
|
Reference in New Issue
Block a user