mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 05:18:00 +02:00
lcl: add TCustomForm.GetFormImage from Gerard Visent (issue #0011292 with modifications)
git-svn-id: trunk@15127 -
This commit is contained in:
parent
5860bfb71a
commit
1fe620b00a
@ -523,9 +523,10 @@ type
|
||||
procedure RemoveHandlerClose(OnCloseHandler: TCloseEvent);
|
||||
procedure AddHandlerCreate(OnCreateHandler: TNotifyEvent; AsLast: Boolean=true);
|
||||
procedure RemoveHandlerCreate(OnCreateHandler: TNotifyEvent);
|
||||
function IsShortcut(var Message: TLMKey): boolean; virtual;
|
||||
function IsShortcut(var Message: TLMKey): boolean; virtual;
|
||||
procedure IntfDropFiles(const FileNames: Array of String);
|
||||
procedure IntfHelp(AComponent: TComponent);
|
||||
function GetFormImage: TBitmap;
|
||||
public
|
||||
// drag and dock
|
||||
procedure Dock(NewDockSite: TWinControl; ARect: TRect); override;
|
||||
|
@ -1766,6 +1766,23 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TCustomForm.GetFormImage: TBitmap;
|
||||
var
|
||||
ARect: TRect;
|
||||
begin
|
||||
Result := TBitmap.Create;
|
||||
try
|
||||
Result.Width := ClientWidth;
|
||||
Result.Height := ClientHeight;
|
||||
LCLIntf.GetWindowRect(Handle, ARect);
|
||||
with GetClientOrigin do
|
||||
PaintTo(Result.Canvas, ARect.Left - X, ARect.Top - Y);
|
||||
except
|
||||
Result.Free;
|
||||
raise;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCustomForm.CreateWnd
|
||||
Params: None
|
||||
|
Loading…
Reference in New Issue
Block a user