@xion: dann würde es immer richtung mitte streben
Danke aber ich konnte das Problem grade mit BenBEs Hilfe slebst lösen
Für alle die's interessiert:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13:
| var mittepixX, mittepixY: integer; begin mittepixX := round(((2 * ScrollBox1.HorzScrollBar.Position + ScrollBox1.Width) / 2) / Lastzoom); mittepixY := round(((2 * ScrollBox1.VertScrollBar.Position + ScrollBox1.Height) / 2) / Lastzoom);
ScrollBox1.HorzScrollBar.Position := round((mittepixX * zoom) - (ScrollBox1.Width / 2)); ScrollBox1.VertScrollBar.Position := round((mittepixY * zoom) - (ScrollBox1.Height / 2));
LastZoom := Zoom; end; |
Zoom wird in in dezimalen angegeben (1 = 100%, 1,5 = 150 % etc)
mfg