Giter Club home page Giter Club logo

Comments (4)

Pernifloss avatar Pernifloss commented on June 25, 2024

hello siddhpuraamitr. i'm glad you are interested in this library.
Imagemap work with 'ratio', if you want to position a point on an image you have to calculate the coordinate so the x and y points ar beetween 0 and 1.

PointF(0.5f, 0.5f) will always get you at the center of your image. PointF(0f, 1f)will get you the bottom left corner, PointF(1f, 0f)the top right etc...

In your case if you have a 500x400 background image and want to positionate a clickable image at 120.0, 140.0 , you have to calculate x and y so they are beetween 0 and 1.
120.0 become 120.0/500 => 0.24f
140.0 become 140.0/400 => 0.35f

the formula is pretyty simple:

x = yourX / backgroundWidth;
y = yourY / bachgroundHeight;

hope this will help.

Pernifloss

from imagemap.

siddhpuraamitr avatar siddhpuraamitr commented on June 25, 2024

Hi sir,

Thank you so much for your nice suggestion,

Sir, I have suggested what you have told me and still find issue, because of in Github I can not attach image so I have posted question in below link

https://stackoverflow.com/questions/44819830/correct-points-value-in-imagemap

Please check and help me

Thank you so much from
Amit Siddhpura

from imagemap.

AchmadFadillah avatar AchmadFadillah commented on June 25, 2024

I want to ask is there another way to get PointF automatically from any image?

from imagemap.

Pernifloss avatar Pernifloss commented on June 25, 2024

Hello, @AchmadFadillah i don't understand how you could "get PointF automatically", the purpose of this librabry is to have clickable images on top of a main background image. The PointF returned in the adapter define where to put a given small image. (I'm closing this issue since it from 2017. please open a new one is you need)

Pernifloss

from imagemap.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.