![]() |
Drag and Drop in FMX mit TImage
Ich habe 2 Timages und möchte jetzt Teile von Image2 auf Image1 mit Drag and drop verschieben.
Hat einer einen Tipp wie das geht oder eine Lösung |
AW: Drag and Drop in FMX mit TImage
Es gibt da keine vorgefertigte Lösung.
Aber im Prinzip ist das ganz einfach und schnell gemacht: 1. Den zu verschiebenden Bereich auf Image1 kannst Du mit einem TSelection auswählen. 2. Für das TSelection setzt Du Dragmode auf dmAutomatic 3. Im Moment des DragStart (DragEnter) den ausgewählten Bereich aus Image 1 in ein Bitmap kopieren 3. Das TSelection auf das 2. Image ziehen und dort im DragoverEvent für "Operation" den Wert auf TragOperation.move setzen, wenn Quelle (Data.source) ein TSelection ist 4. Im Ondrop-Event an die Stelle des aktuellen TSelections im Image 2 das zuvor kopierte Bitmap reinkopieren, Ursprungsbereich in Image 1 leeren Bitmap im Ursprungsbereich kopierst Du mit Image1.Bitmap.canvas.copybitmap (...) und im Zielbereich malst Du mit Image.bitmap.Canvas.DrawBitmap rein. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:04 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz