Forum: Sonstige Fragen zu Delphi
Delphi
by Medium,
6. Mai 2010
Ähm, was hast du überhaupt vor? Also was genau hast du, und wo willst du hin? Ich glaube, du bist hier auf einem höheren Level aufm falschen Dampfer.
Forum: Sonstige Fragen zu Delphi
Delphi
by Medium,
6. Mai 2010
Nein. Die Funktion interpretiert (0,0) als Bildschirmkoordinate, und gibt dir diese relativ zu (Image.Left, Image.Top).
Ein Image ist schon ein bischen komplizierter, aber tun wir das mal:
Annahmen:
Image.Top = 80
Image.Left = 100
Image liegt auf Form (und nicht innerhalb eines weiteren Panels oder sonstiges, einfach nackt aufm Form).
Forum: Sonstige Fragen zu Delphi
Delphi
by Medium,
6. Mai 2010
ClientToScreen() und ScreenToClient() fragen die Mausposition nicht selbsttätig ab, das musst du schon noch selber tun. Dafür ist ja der Parameter vom Typ TPoint gedacht. Die Funktionen sind dazu gedacht, dass wenn man z.B. mit Mouse.CursorPos die Bildschirmkoordinaten erfragt hat, man aber die relativen Koords zu einem Formular braucht, diese mit
var
formRelativePos: TPoint;
begin
...