Einzelnen Beitrag anzeigen

Niko

Registriert seit: 23. Jun 2003
416 Beiträge
 
Delphi 2006 Professional
 
#7

Re: Maus in TImage einsperren (Mäusefalle)

  Alt 8. Mai 2004, 14:36
Für das Problem gibt es die Methode ClientToScreen, die Formularkoordinaten in Bildschirmkoordianten umwandelt:
Delphi-Quellcode:
var
  P: TPoint;
//...
  P.X := image1.Left;
  P.Y := image1.Top;
  P := Form1.ClientToScreen(P);
  rec.Left := P.X;
  rec.Top := P.Y;
  rec.Right := P.X + image1.Width;
  rec.Bottom := P.Y + image1.Height;
"Electricity is actually made up of extremely tiny particles called electrons, that you cannot see with the naked eye unless you have been drinking." (Dave Barry)
  Mit Zitat antworten Zitat