Autor Beitrag
knut333
Hält's aus hier
Beiträge: 5



BeitragVerfasst: Do 29.09.05 15:48 
Ich brauche folgende Funktion, weiß aber nicht wie ich das mache:

Ich habe ein Image (600 x 500). Man soll auf das Image klicken können und diese Koordinaten (zum Beispiel 120 x 358) sollen ermittelt werden.

Könnt ihr mir helfen?
LH_Freak
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 385

Win XP
D7 PE, D2k5 Trial
BeitragVerfasst: Do 29.09.05 15:58 
bei nem Image?
einfach bei OnMouseDown dann X, und Y abfragen
knut333 Threadstarter
Hält's aus hier
Beiträge: 5



BeitragVerfasst: Do 29.09.05 16:01 
und mit welchen befehlen frage ich x und y ab?

image1. ... ?
LH_Freak
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 385

Win XP
D7 PE, D2k5 Trial
BeitragVerfasst: Do 29.09.05 16:04 
hast du dir schonmal MouseDown angeschaut?

Musst dir global zwei Integers oder meinetwegen auch einen Pointer einführen und anschließend bei OnMouseDown z.B. so machen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
geklickt.x := x;
gelickt.y := y;

{Bei integern das:
gx := x;
gy := y
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 29.09.05 16:59 
Hallo,

Mousedown ist schon richtig,
aber eine globale Variable brauchst du nicht, denn
ausblenden Delphi-Quelltext
1:
2:
procedure TForm1.Image1MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; XY: Integer);
liefert Dir schon die Koordinaten.
Möchtest Du die Koordinaten bezogen auf den Desktop haben,
kannst du sie mit der Funktion ClientToScreen umrechnen.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
LH_Freak
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 385

Win XP
D7 PE, D2k5 Trial
BeitragVerfasst: Do 29.09.05 17:45 
oder auch einfach GetCursorPos(Zeilpointer)
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Fr 30.09.05 14:27 
Pointer <> TPoint!!!!!!!!!!!!!!! Sollte man keinesfalls verwechseln!
LH_Freak
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 385

Win XP
D7 PE, D2k5 Trial
BeitragVerfasst: Fr 30.09.05 14:28 
Ja klar, da war ich geistig immer noch bei OGL