Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8886321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:31:52+00:00 2026-06-14T21:31:52+00:00

I’ve been going through the Android tutorials and examples on creating 3D applications. My

  • 0

I’ve been going through the Android tutorials and examples on creating 3D applications. My goal is to create an app that I can display a 2D image that I can zoom/pan with nodes overlayed that can be touched for a context menu.

I started with implementing a GLSurfaceView but switched to a custom ImageView that implements a pinch-to-zoom and panning touch listener. It works well for display, panning, and zooming my image.

I now need to figure out how to display nodes (which would be an image or sprite) at specific coordinates on the image, and when the image is panned/zoomed, have the nodes move and scale accordingly.

Should this be implemented as another View on top of the primary ImageView? I’m assuming I’ll have to manipulate the nodes at the same time the ImageView is manipulated.

I’m also stuck on API 10. Any ideas would be greatly appreciated. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T21:31:53+00:00Added an answer on June 14, 2026 at 9:31 pm

    I believe you will have to manipulate the nodes position aligned with image.

    You can use the code bellow to to add programatically an ImageView in your layout in a specific position (and force size if you want).

    It’s just an example and is using a fixed drawable (which you should change to pass as parameter to the method). You can also change it move a already existing view instead of adding.

    private ImageView addImageView(RelativeLayout mainLayout, int x, int y, int width, int height, OnClickListener onClickListener){
        ImageView imageView = new ImageView(this);
        imageView.setAdjustViewBounds(false);
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        params.height = height;
        params.width = width;
        imageView.setLayoutParams(params);
        imageView.setScaleType(ImageView.ScaleType.FIT_XY);
        imageView.setImageDrawable(getResources().getDrawable(R.drawable.marker_red));
        //imageView.setBackgroundColor(Color.BLUE);
        params.leftMargin = x - width/2;
        params.topMargin = y - height/2;
        imageView.setOnClickListener(onClickListener);
        mainLayout.addView(imageView);
        return imageView;
    }
    

    Let me know if you need more details.

    –EDITED–

    To get position within parent layout you can use getX() and getY() if you are using API 11 or above.

    If you are on API < 11, then you can get the raw position (within screen) using:

    private boolean inViewBounds(View view, int x, int y){
        view.getDrawingRect(outRect);
        view.getLocationOnScreen(location);
        outRect.offset(location[0], location[1]);
        return outRect.contains(x, y);
    }
    

    and you will need to subtract parent layout raw coordinates to obation coordinates relative to parent.

    Hope it helps.

    Regards.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I am doing a simple coin flipping experiment for class that involves flipping a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.