0 Üye ve 1 Ziyaretçi konuyu incelemekte.
unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls,jpeg;type TForm1 = class(TForm) Timer1: TTimer; Panel1: TPanel; Image1: TImage; procedure Timer1Timer(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Timer1Timer(Sender: TObject);varSrect,Drect,PosForme:TRect;iWidth,iHeight,DmX,DmY:Integer ;iTmpX,iTmpY:Real;C:TCanvas;Kursor:TPoint;ZoomFactor: Integer;beginbeginGetCursorPos(Kursor);PosForme:=Rect(Form1.Left,Form1.Top,Form1.Left+Form1.Width,Form1.Top+Form1.Height);If not PtInRect(PosForme,Kursor) thenbeginIf Panel1.Visible=True then Panel1.Visible:=False;If Image1.Visible=False then Image1.Visible:=True;iWidth:=Image1.Width;iHeight:=Image1.Height;Drect:=Rect(0,0,iWidth,iHeight );ZoomFactor := 1;iTmpX:=iWidth / (ZoomFactor * 4);iTmpY:=iHeight / (ZoomFactor * 4);// FARE İMLECİ GÖZÜKMÜYOR FARE NİN GÖRNMESİ İÇİN NE YAPABİLİRİM// NO MOUSE, HOW TO SCREEN MOUSE İN VİSİBLESrect:=Rect(Kursor.x,Kursor.y, Kursor.x,Kursor.y);InflateRect(Srect,Round(iTmpX) ,Round(iTmpY));If Srect.Left<0 then OffsetRect(Srect,-Srect.Left,0);If Srect.Top<0 then OffsetRect(Srect,0,-Srect.Top);If Srect.Right>Screen.Width then OffsetRect(Srect,-(Srect.Right-Screen.Width),0);If Srect.Bottom>Screen.Height then OffsetRect(Srect,0,-(Srect.Bottom-Screen.Height));C:=TCanvas.Create;tryC.Handle:=GetDC(GetDesktopWindow);Image1.Canvas.CopyRect(Drect,C ,Srect);finallyC.Free;end;Application.ProcessMessages;endelsebegin If Panel1.Visible=False then Panel1.Visible:=True;If Image1.Visible=True then Image1.Visible:=False;end;end;end;end.