After changing the bitmap by creating bitmap again, the size of the bitmap is derived from the original. Why? Bitmap Sample Size Factor: 2
The width of the converted image: 142 height: 69
To use the code below:
Bitmapfactor. Option bitmap option = new bitmapfactor. Option (); BitmapOptions.inSampleSize = powerOf2; BitmapOptions.inPurgeable = true; BitmapOptions.inInputShareable = true; BMP = Bitmap Feature DeDebateArere (IMGRABITS, 0, IMGRABites.Lamp, Bitmap option);
This is expected behavior because you are bitmapOptions.inSampleSize = 2 . In fact, the docs have been clearly explained, if inSampeSize> 1 , decoder will greet the original image. From:
If the value and gt; 1, to save a small image to save memory, requests the decoder to salt the original image, the sample size is either the number of pixels in the dimension that corresponds to a pixel in the decoded bitmap. For example, inSampleSize == 4 returns an image which is the width / height of the 1/4 root and the number of 1/16 pixels. Any value & lt; = 1 is considered as 1. Note: The decoder will attempt to fulfill this request, but the resulting bitmap may have different dimensions that are properly requested. Apart from this, 2's powers are often fast / easy to honor the decoder.
Comments
Post a Comment