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

  • SEARCH
  • Home
  • 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 8163483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:04:16+00:00 2026-06-06T19:04:16+00:00

I have an Activity containing an ImageView and I’d like to allow the User

  • 0

I have an Activity containing an ImageView and I’d like to allow the User to select part of it’s content with the touch (or mouse click) capabilities.

I’d like to write a procedure able to achieve two things:

  1. Draw a highlighted window over the selected parts of the image
  2. Return an object containing the coordinates of the selected (highlighted) pixels.

For better understanding you can check the little mock up I’ve created:

enter image description here

The User should touch the screen over some part of the image and it should get highlighted. When pressing the back button I’d like to obtain via Java the coordinates of the pixels that were highlighted.

Can you help me understand how to do?

In particular I’d like to find out the following:

  1. should I access pixel level information of the image?
  2. which classes are needed to implement this functionality?
  3. some idea of pseudo code?

Thks for any kind of help!

  • 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-06T19:04:17+00:00Added an answer on June 6, 2026 at 7:04 pm

    I would subclass ImageView then you can capture the touch events by overriding onTouchEvent(...)

    When you get to the onDraw(...) method you can call super to draw the image as normal, then add your own code to draw a highlight over the top.

    EDIT

    Well instead of using ImageView you can extend it and write your own class, all this class has to do is override onTouchEvent(...) so you know when the view is being touched and can save the location on screen of the touch events. Next you edit the drawing methods:

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas); // So the image you want is drawn as normal
    
        myMethodForDrawingAFancyHighlight(Canvas canvas); // add your special effects on top of the image
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Activity with a layout containing a custom ImageView and a few
Suppose I have a database containing 3 tables in a grails application: User Activity
I have an activity containing two imagebuttons. If the user clicks back an alertDialog
I have an Activity containing a ViewFlipper and would like to show a different
I'd like to create an Activity containing a list in which the rows have
Currently I have a TabHost implemented with 3 tabs each containing a separate activity.
Let's say I have an Activity which displays a View containing a TextView .
I have a UIPicker with 3 components containing numeric values, this allows the user
In my android application I have an activity containing a Parcelable object (implements Parcelable
I have a android app project in Eclipse, and in my activity containing 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.