![]() |
|
مصورالشاشة - نسخة قابلة للطباعة +- delphi4arab منتديات دلفي للعرب (https://delphi4arab.net/forum) +-- قسم : منتديات دلفي للعرب التعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=3) +--- قسم : مصادر دلفي مفتوحة تعليمية (https://delphi4arab.net/forum/forumdisplay.php?fid=14) +--- الموضوع : مصورالشاشة (/showthread.php?tid=1752) |
مصورالشاشة - King SofT - 05-03-2010 [B]بسم الله لرحمان الرحيم[/B]
السلام عليكم اخوتي اتقدم لكم بمشروعي البسيط هذا وهو كيفية عمل مصور للشاشة بواسطة الدلفي كود : procedure TForm1.Capturer1Click(Sender: TObject);
Var
Bool: Boolean;
touche: Byte;
DesktopHWnd: HWnd;
DesktopDC: HDc;
begin
FormStyle:=fsStayOnTop;
Touche :=VK_SNAPSHOT;
Application.Minimize;
Application.ProcessMessages;
Bool := (GetAsyncKeyState(Touche) and 1 = 1);
Repeat Application.ProcessMessages;
Bool := (GetAsyncKeyState(Touche) and 1 = 1);
Until Bool or Application.Active;
If Bool then
Begin
DesktopHWnd := GetDesktopWindow;
DesktopDC := GetDC(DesktopHWnd);
Image1.Picture.Bitmap.Width:=Screen.Width;
Image1.Picture.Bitmap.Height:=Screen.Height;
BitBlt(Image1.Picture.Bitmap.Canvas.Handle,0,0,
Screen.Width,Screen.Height,GetDC(GetDesktopWindow),0,0,SrcCopy);
ReleaseDC(DesktopHWnd, DesktopDC);
Application.Restore;
form1.BorderStyle:=bsNone;
form1.WindowState:=wsMaximized;
end; |