简体   繁体   中英

Is BitmapFactory really necessary when it comes to only resizing images (png) in this scenario?

I'm trying to use code from this answer(the 1st one, the highest rated one):

Android - combine multiple images into one ImageView

After reading extensively the code I found out that the code was using BitmapFactory extensively.

I'm trying to integrate the code into a performance-priority project, and bitmap left me with the impression of being rather taxing on processors, which isn't really something I'm pleased with. I don't want this new part of the code slow everything down noticeably.

My code is already capable of resizing pngs, so I'm guessing either one of the following is likely be the case of the original author's application of BitmapFactory:

  1. resizing pngs uses bitmap processing by default, just because I (author of this question, not of the code IN this question) did not explicitly call relevant functions doesn't mean it hasn't gotten actively involved;

  2. The code also features capability of cutting and reshaping images so that is exclusively the part that needs BitmapFactory, BitmapFactory isn't really necessary if nothing beyond resizing is required.

  3. The code's primary function is to combine multiple images inside a single imageView so to have that, BitmapFactory is instrumental in achieve just that (I've read the code but couldn't find enough evidence to support this assumption).

I need expert answer - a simple yes or no followed by clear elaboration. Thanks in advance. You are of course, welcome to point out my lapse of judgement when claiming that bitmap slows things down.

To answer my own question:

In this particular scenario, unfortunately I need to use bitmap to "map" (no pun intended) my target image, and then resize it and put it into the same ImageView with other images that went through the identical steps. Because I am trying to combine several images inside a single view, this is inevitable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM