Can't get Gestures working on TImage Object in Delphi XE5

907 views Asked by At

I'm writing an Android app and am having some problems using gestures to slide through images. I have a client data set with a Blob field called SavedPicture which is bound visually to the TImage.

I initially made 2 buttons, previous and next, for scrolling through the images. The code behind them was simply Dataset.Next; and Dataset.Prior;

However I want to be able to swipe the image left or right to view other images. I made a TGestureManager object, linked it to the TImage, ticked Left and RIght under Standard Gestures then had the following in the OnGesture event of the TImage:

if EventInfo.GestureID = sgiLeft then
  dmdPD.cdSavedPics.Prior;
if EventInfo.GestureID = sgiRight then
  dmdPD.cdSavedPics.Next;

However, this doesn't work at all. If I assign the GestureManager to something else, like the form itself, and put this exact same code in the OnGesture event, it works fine.

What am I doing wrong?

Thanks.

0

There are 0 answers