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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:07:52+00:00 2026-06-15T12:07:52+00:00

Say I’ve got a fully rectangle image: Now when I show it in an

  • 0

Say I’ve got a fully rectangle image:
enter image description here

Now when I show it in an ImageView, I want one corner to be cut off, like this:
enter image description here

How can I achieve this on runtime?

  • 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-15T12:07:53+00:00Added an answer on June 15, 2026 at 12:07 pm

    I’ve solved it using this code:

        public static Bitmap maskImage(Context context, Bitmap original) {
                if (original == null)
                        return null;
    
                Bitmap result = Bitmap.createBitmap(original.getWidth(), original.getHeight(), Config.ARGB_8888);
                Canvas c = new Canvas(result);
                Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
                paint.setColor(android.graphics.Color.WHITE);
                paint.setStyle(Paint.Style.FILL);
                paint.setAntiAlias(true);
    
                Path path = new Path();
                path.moveTo(result.getWidth(), result.getHeight());
                path.lineTo(result.getWidth() - dpToPx(context, CORNERWIDTHDP), result.getHeight());
                path.lineTo(result.getWidth(), result.getHeight() - dpToPx(context, CORNERHEIGHTDP));
    
                path.close();
    
                paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_OUT));
    
                c.drawBitmap(original, 0, 0, null);
                c.drawPath(path, paint);
    
                paint.setXfermode(null);
                return result;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I got this situation: I have to filter one of my entities with
Say I have a Telerik MVC Grid, AJAX bound and I want to put
Say we have deep hashes like: b = {1 => {2 => {} },
Say i have a few fields like the following: abd738927 jaksm234234 hfk342 ndma0834 jon99322
Say I want to draw a Ball in the scene and here are two
Say I have a byte array with 100,000 bytes in it. I want to
Say in my js file I want to have var NO = 0; var
Say I have a higher kinded type SuperMap[Key[_],Value[_]]`. Suppose now that I had something
Say, the field of Race in my table has values like W,A (white and
Say I have two classes like this: class A{ private static Random random =

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.