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:
@ -445,6 +445,7 @@ type
|
||||
procedure SavePreferences(const aFileName : string);
|
||||
function SetNewBrowserParent(aNewParentHwnd : HWND) : boolean;
|
||||
procedure ResolveHost(const aURL : ustring);
|
||||
function TakeSnapshot(var aBitmap : TBitmap) : boolean;
|
||||
|
||||
procedure ShowDevTools(inspectElementAt: TPoint; const aDevTools : TWinControl);
|
||||
procedure CloseDevTools(const aDevTools : TWinControl = nil);
|
||||
@ -784,7 +785,7 @@ begin
|
||||
if (FHandler = nil) then
|
||||
begin
|
||||
FIsOSR := aIsOsr;
|
||||
FHandler := TVCLClientHandler.Create(Self, FIsOSR);
|
||||
FHandler := TCustomClientHandler.Create(Self, FIsOSR);
|
||||
Result := True;
|
||||
end;
|
||||
except
|
||||
@ -2023,6 +2024,42 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TChromium.TakeSnapshot(var aBitmap : TBitmap) : boolean;
|
||||
var
|
||||
TempHWND : HWND;
|
||||
TempDC : HDC;
|
||||
TempRect : TRect;
|
||||
TempWidth : Integer;
|
||||
TempHeight : Integer;
|
||||
begin
|
||||
Result := False;
|
||||
|
||||
if not(FIsOSR) then
|
||||
begin
|
||||
TempHWND := GetWindowHandle;
|
||||
|
||||
if (TempHWND <> 0) then
|
||||
begin
|
||||
Winapi.Windows.GetClientRect(TempHWND, TempRect);
|
||||
|
||||
TempDC := GetDC(TempHWND);
|
||||
TempWidth := TempRect.Right - TempRect.Left;
|
||||
TempHeight := TempRect.Bottom - TempRect.Top;
|
||||
|
||||
if (aBitmap <> nil) then FreeAndNil(aBitmap);
|
||||
|
||||
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;
|
||||
|
||||
procedure TChromium.SimulateMouseWheel(aDeltaX, aDeltaY : integer);
|
||||
var
|
||||
TempEvent : TCefMouseEvent;
|
||||
|
Reference in New Issue
Block a user