0

I already tried

In all of the above cases,

After setting the image in the view, I got bitmap from the view using the above methods, and I could see that all of them lost quality by applying it to this view again.

Is there any way not to lose quality?

Please help me, I haven't solved it for three weeks.

70M P0M
  • 29
  • 2
  • Have you tried creating a canvas backed by a bitmap and forcing your view to `draw(canvas)` on it? There's a lot of answers explaining how to do that – Pawel Feb 15 '21 at 14:09
  • @Pawel I think the way you mentioned it was the third way I mentioned it. (https://stackoverflow.com/questions/52642055/view-getdrawingcache-is-deprecated-in-android-api-28) – 70M P0M Feb 15 '21 at 14:16
  • `After setting the image in the view` Why would you? If you have an image then make a bitmap of it right away. Dont use an intermediate view unless you have good reasons. – blackapps Feb 15 '21 at 14:49
  • Why dont use bitmaps? – Juan Sancho Feb 15 '21 at 15:08
  • @blackapps For test on image quality after bitmap conversion of view. – 70M P0M Feb 16 '21 at 12:01
  • 1
    @JuanSancho what do you mean ?? I am making photo editor app, I should get bitmap from view without losing its quality – 70M P0M Feb 16 '21 at 12:03
  • I can understand that you wanna display a bitmap. But do not get a bitmap from a view but of your image. – blackapps Feb 16 '21 at 12:04
  • You should edit your bitmap only. And after every edit display it in your view. The bitmap is your source. The view only to have a look. The view has much less resolution then your bitmap. – blackapps Feb 16 '21 at 12:06
  • @blackapps I am making a photo editor app. Ultimately, images imported from the gallery should be re-saved in good quality, and the image quality difference between the images initially imported and those gotton from the view in three ways above is severe. – 70M P0M Feb 16 '21 at 12:10
  • @blackapps My app has the ability to attach stickers to pictures. – 70M P0M Feb 16 '21 at 12:12
  • Well then you are doing it in the wrong way. – blackapps Feb 16 '21 at 12:12
  • Attach the stickers to the bitmap. – blackapps Feb 16 '21 at 12:12
  • @blackapps How do I attach a image to a image..? I've been doing it by adding photo views(sticker views) to the root view. – 70M P0M Feb 16 '21 at 12:15
  • I did not say that you should attach to an image. And i did say to not use views for picture handling. I talked about a bitmap. Please be clear to use the words bitmap/image/picture in such a way that we know what you mean. But in general you copy an area of one bitmap to another bitmap. Or on canvasses. – blackapps Feb 16 '21 at 12:26

0 Answers0