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 8320785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T22:46:50+00:00 2026-06-08T22:46:50+00:00

I have a problem: I would like to draw a grey overlay on an

  • 0

I have a problem: I would like to draw a grey overlay on an image. There is a path and I would like to colour outside of the path. Clipping is not good, because the edges are not anti-aliased (and I have to make it work on 2.1).

I have made it work on camera (right side). There is a FrameLayout, holding a SurfaceView (camera preview) and a View over it. The view fills the overlay color on full canvas, then with xfermode deletes the paths (Mode.CLEAR).

Using the same method I get the picture on the right.
First I made my View an ImageView descendant, but that was completely bad. Then, I added an ImageView with the image below my view (like the camera preview), but the same result. Then Used other imageview out of the framelayout, but same. Of course, I always tried to set the bgcolor to transparent, draw Color.TRANSPARENT, but it didn’t work. I don’t know what is the problem. Maybe Mode.CLEAR clears the whole screen on that area? Why it is working with camera surfaceview and not with and imageview (or even another surfaceview)?

I have been googling for 7 hours, and no real solutions. Can you please help me what I am doing bad, and share some “tricks”? As I said before, I need anti-aliased edges (severals shapes have many curves and diagonals), so I cannot clip (not even if drawing strokes, its awful).

Thank you in advance.

Figure: http://s16.postimage.org/72bcp5kad/img_overlay.jpg

  • 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-08T22:46:53+00:00Added an answer on June 8, 2026 at 10:46 pm

    I have found a solution. I build a path containing the full canvas too, then filling it EVEN_ODD. So start at leftmost point -> left side ->topleft -> topright -> bottomright->bottomleft->leftside->leftmost point->other poly points. And works 🙂

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

Sidebar

Related Questions

I have a problem i would like parallelize two for loops with openmp. how
i have the following problem: i would like to create a footer. that footer
Ok, I have the following problem: I would like to scroll an overflowing ListBox
I have a little problem where I would like to insert a svn diff
I have a reasonably complex layout problem: I would like to have a main
I have a problem, I would like to build logging system which will be
I have a problem with apache2 settings (Ubuntu system). I would like to run
I have an interesting genetics problem that I would like to solve in native
I have got very big problem because I would like to get more information
I have come across a strange problem which I would like to get your

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.