How to get genearate id while clicked that place to show number in image like(1,2,3,4) UI level is there any chance to achieve in both and Android and ios in xamarin or renderer. Thanks Advance
I am using Sfimageditor when I clicked particular position tap am getting x and y position based on I have to show the numbers on that posotion
Xaml code
<StackLayout Orientation="Vertical" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<local:CustomImage x:Name="Img" TapEvent="Img_TapEvent" Source="{Binding PhotoSource}" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Aspect="AspectFit">
<local:CustomImage.GestureRecognizers>
<TapGestureRecognizer Command="{Binding ImageTapCommand}" />
</local:CustomImage.GestureRecognizers>
</local:CustomImage>
</StackLayout>
When clicked PhotoSource and save to generate id shows in UI level in image
Android Customimagerendeer:
public bool OnTouch(Android.Views.View v, MotionEvent e)
{
float Xaxis = e.GetX();
flaot Yaxis = e.GetY();
return false;
}
Ios Customimagerendeer:
public void TapHandler(UITapGestureRecognizer tgr)
{
CGPoint touchPoint = tgr.LocationInView(nativeElement);
formsElement.OnTapEvent(float Xaxis = (float)touchPoint.X, float Yaxis = (float)touchPoint.Y);
}