Set text in text mode very blurry

I am learning how to completely blur text in text form. Read completely unreadable (pixelate). The methods I use use shadows. But it seems very inefficient. Anyone who has a better solution?

+4
source share
3 answers

I did not like the Paint method used in other answers. The following code works for me with a radius calculated based on the font size and applying it directly to the TextView.

if (Build.VERSION.SDK_INT >= 11) { yourTextView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); } float radius = yourTextView.getTextSize() / 3; BlurMaskFilter filter = new BlurMaskFilter(radius, BlurMaskFilter.Blur.NORMAL); yourTextView.getPaint().setMaskFilter(filter); 
+10
source

You should try using canvas instead of TextView and paint the text with blur. There are many methods using BlurMaskFilter , and you can use it as follows:

 paint.setMaskFilter(new BlurMaskFilter(float radius, BlurMaskFilter.Blur style)); 
+4
source

You can try the following methods:

  • Whenever you want to show blurry text, use a special font for your TextView added to the resource folder of your project.
  • Try adjusting the transparent color [ #00ffffff ] to your text and give it a shadow.

I hope one of the above methods helps.

0
source

Source: https://habr.com/ru/post/1481160/


All Articles