Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image mapping
#3
(09-20-2020, 04:57 AM)Alexandre Machado Wrote: TIWImage.OnAsyncMouseDown is the event that you are looking for.

Add an OnAsyncMouseDown event to your image and add this code to it:

Code:
procedure TIWForm1.IWImage1AsyncMouseDown(Sender: TObject; EventParams: TStringList);
var
  x, y: Integer;
begin
  x := imagMap.GetAsyncParam('X', 0);
  y := imagMap.GetAsyncParam('Y', 0);
  WebApplication.ShowMessage('X = ' + IntToStr(x) + ', Y = ' + IntToStr(y));
end;

Hi, Alexandre!

Thank you for your answer. Unfortunatelly I'm trying to use bootstrap image and the coordinates are changing according to image size. For example original image size is 1000 x 1000. If I clicked on lower right corner, I get coordinate 1000x1000 (on PC browser), but when I checked that image on the phone and clicked on the same position, I'm getting coordinate 500x500. Is there any way to get image size after adapting new size or maybe to get scaled ratio on that image so I could figure out position based on original size? 

Kind regards,
Bostjan
Reply


Messages In This Thread
Image mapping - by bostjan - 09-16-2020, 11:03 AM
RE: Image mapping - by Alexandre Machado - 09-20-2020, 04:57 AM
RE: Image mapping - by bostjan - 09-20-2020, 10:46 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)