Posted By

m3000 on 09/05/17


Tagged

bitmap #circular


Versions (?)

Make circuar bitmap


 / Published in: Java
 

this is the code to make the circular bitmap and use it in the image views and other viewers in android technology. at the end of the code the circle mode of bitmap is created by the en um Mode.

  1. private Bitmap getCircleBitmap(Bitmap bitmap) {
  2. final Bitmap output = Bitmap.createBitmap(bitmap.getWidth(),
  3. bitmap.getHeight(), Bitmap.Config.ARGB_8888);
  4. final Canvas canvas = new Canvas(output);
  5.  
  6. final int color = Color.RED;
  7. final Paint paint = new Paint();
  8. final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
  9. final RectF rectF = new RectF(rect);
  10.  
  11. paint.setAntiAlias(true);
  12. canvas.drawARGB(0, 0, 0, 0);
  13. paint.setColor(color);
  14. canvas.drawOval(rectF, paint);
  15.  
  16. paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
  17. canvas.drawBitmap(bitmap, rect, rect, paint);
  18.  
  19. bitmap.recycle();
  20.  
  21. return output;
  22. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: DylanParker on October 17, 2017

Thank you for sharing. Here's another code to achieve the roundedImageview: ImageView profilePic = (ImageView) findViewById (R.id.userimage); // get bitmap of the image Bitmap imageBitmap = BitmapFactory.decodeResource (getResources (), R.drawable.largeicon); RoundedBitmapDrawable roundedBitmapDrawable = RoundedBitmapDrawableFactory.create (getResources (), imageBitmap); // setting radius roundedBitmapDrawable.setCornerRadius (50.0f); roundedBitmapDrawable.setAntiAlias (true); profilePic.setImageDrawable (roundedBitmapDrawable). more you can find on my website.

Posted By: fin337sun on November 8, 2017

https://speedypaper.com/paraphrasing-rewriting - this is not just a link. It can rescue every student who seeks help with his or her writing assignment. Save and share it!

Posted By: fin337sun on November 8, 2017

https://speedypaper.com/paraphrasing-rewriting - this is not just a link. It can rescue every student who seeks help with his or her writing assignment. Save and share it!

Posted By: KerryWin89 on November 9, 2017

Thanks for sharing this information! Useful for my https://rocketpaper.net/global-warming-essay-writing and other essay topics at all.

Posted By: KerryWin89 on November 9, 2017

Thanks for sharing this information! Useful for my [url]https://rocketpaper.net/global-warming-essay-writing[url] and other essay topics at all.

Posted By: KerryWin89 on November 9, 2017

Thanks for sharing this information! Useful for my and other essay topics at all.

Posted By: KerryWin89 on November 9, 2017

Thanks for sharing this information! Useful for my

Posted By: John32 on November 17, 2017

All paper writing companies try to assure you in providing the best services to attract as many college students as possible. Of course, there are services that keep their promise. However, there are also services that do not care about delivering quality essay help but only want to get your money. Read the detailed ultius review in order to not be scammed.

Posted By: rosshickers on May 4, 2018

In the code, everything seems so complicated. Especially difficult when you write the code yourself and you're a beginner developer. For my site https://1custompapers.com/do-my-coursework/ which is engaged I consulted a lot to work with images. But it seems to me that we should not stop there.

Posted By: rosshickers on May 4, 2018

I want to add that when you work with a site that was previously in the works of another developer, for example do your homework, you push with the problem of style.

Posted By: BobWilliams on May 7, 2018

An excellent resource for articles on medical topics https://nursingessaywriting.com/

Posted By: henryweston340 on July 18, 2018

Obviously, there are administrations that stay faithful to their commitment. Notwithstanding, there are additional benefits that couldn't care less about conveying quality exposition help however just need to get your cash. Read the itemizedEssay Introduction audit with a specific end goal to not be defrauded.

Posted By: Reno on August 31, 2018

I have been looking for this code on the circular bitmap, Thanks a lot for posting this code. Do a visit to olpairkodifix.com to explore more.

Posted By: colineddie05 on August 31, 2018

Afterward, he won a grant to Oxford College, an exceptionally lofty school. About that time he concluded that he didn't trust that God existed. Along these lines, he called himself an agnostic. At Oxford, he faced off regarding Christians who gave him authentic and consistent motivations to accept.
Improve Your Writing Skills

Posted By: JaidaCordell on September 6, 2018

I have a bitmap and I want to crop a circular region from this bitmap. All pixels outside the circle should be transparent. How can I do this? Regards, Jaida from Handmade writings

Posted By: Jane15818 on September 9, 2018

Thank you for this post. This is very interesting information for me. Just contact www.writingpapersucks.com/ if you looking for the best essay service.

Posted By: nathanwilliam on September 20, 2018

Sparkling sand on the golden beaches, enthralling cricket matches in packed stadiums, open-pit barbecue parties over the weekend, and a dynamic work scene define some of the factors that are quintessentially Australian. Presenting a plethora of possibilities for enterprising individuals, the land of kangaroos is an inviting destination for spreading the wings of your professional life. If you have a mind to migrate to Australia on a quest for better prospects for your engineering career, then you must know all about the many stringent guidelines Engineers Australia for evaluating your skills and competencies in engineering specialisations. The main elements of an ideal Cdr Engineers Australia include: If you wish to submit impressive CDR, then it is quite important on your part to consider hiring genuinely helpful cdr report writers. None other than the genuinely experienced and resourceful CDR writers can assure you of a well-crafted CDR end of the day. Thus, it is suggested to put some serious effort in figuring out whether the writer associated with the firm is real. Go through the profile section, look for the author bio and similar sets of information to check and confirm how informatively are the sections filled with enough clarity on their individual professional credibility. Lastly, editing and proofreading services your CDR multiple times after you finish composing it. An error-free CDR sans any grammatical, punctuation or typographical mistake will never fail to impress, so don your best editing cap and revise your CDR to flawless perfection. Follow these simple tips to compose an impressive CDR that is sure to leave its mark among the thousands of applications that Engineers Australia receives every year, and enhance your chances of ensuring a smoother migration process devoid of too many hassles greatly. Good luck with your CDR!

Posted By: Willmore on September 27, 2018

As a student, I often used this writing app. The team of professionals did a quick and high-quality work!

Posted By: raihnamh on September 28, 2018

MyAssignmenthelp.com being one of the most active Assignment Help websites has a pool of over 4500+ assignment experts from Australia, UK and US. They are highly qualified and skilled professional writers who have vast experience in writing assignments, dissertations, essays, research papers, term papers etc. Each expert is chosen after rigorous testing and has to prove his academic credentials.

Posted By: theresadelcas on October 3, 2018

My Assignment Services provides a 24-hour online assignment help or academic assistance and consultation to the students. Be it any subject such as Nursing, Economics, Law, Engineering, or Management, we provide the most reliable help with assignment online by our highly-proficient academic writers. This is because there are a multitude of online academic help services and picking the best is always going to be a trial and error method. However, My Assignment Services is a well-established and prominent name in the best assignment provider & high-quality instant assignment help online to students since almost a decade. You can trust our academic ghostwriters completely to get best quality write-ups including case studies, research proposals, dissertations and theses, and more. Australian Assignment Help providing experts understand that price is one of the major factors that university students consider before paying someone to do it for them. This is because university students often have stringent budgets and are already burdened with student debts. This is why we offer regular and seasonal discounts on Accounting Assignment Help or other assignments so that you achieve high distinction without burning a hole in your pocket.

Posted By: dylaneales on October 4, 2018

sampleassignment.com is the leading brand in Australia for assignment help that offers complete University assignment help services like contract law assignment, it assignment help, financial assignment help, project management assignment, literature review assignment help electrical engineering help and more. Where most students lack time, subject-knowledge, and writing skills, Sample Assignment brings them highly qualified subject experts who can write their assignments for them at affordable rates or for those who looking for assignment help adelaide. We have three teams who fully understand student problems and try to help them get over those problems.

Posted By: dylaneales on October 4, 2018

Those who are searching over internet 'economics assignment help'contact with us now. We are the best assignment writing service provider in Australia. Our Academic assignment writers available 24*7 hours for the students, if you really want to need assignment help online at cheapest price meet assignment helper at sample assignment and get high distinction grades. We are here to help you with 100% plagiarism free assignment help perth Australia. We offers lowest price on all kind of dissertations, essay,marketing assignment help and more from 4000+ Ph.D. Experts

Posted By: tonywells on November 8, 2018

When people and students especially are searching in the Internet for

Posted By: tonywells on November 8, 2018

When people and students especially are searching in the Internet for

You need to login to post a comment.