Class BitmapUtils


  • public class BitmapUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      BitmapUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static android.graphics.Bitmap decodeSampledBitmapFromUri​(android.content.Context context, android.net.Uri uri, int reqWidth, int reqHeight)
      Decode a sampled bitmap to the required width and height.
      static Dimensions getBitmapDimensions​(android.content.Context context, android.net.Uri uri)
      Get bitmap's dimensions.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BitmapUtils

        public BitmapUtils()
    • Method Detail

      • decodeSampledBitmapFromUri

        public static android.graphics.Bitmap decodeSampledBitmapFromUri​(android.content.Context context,
                                                                         android.net.Uri uri,
                                                                         int reqWidth,
                                                                         int reqHeight)
                                                                  throws java.io.FileNotFoundException
        Decode a sampled bitmap to the required width and height.
        Parameters:
        context - Android context.
        uri - Bitmap's source uri.
        reqWidth - Required width for the bitmap to be adjusted to.
        reqHeight - Required height for the bitmap to be adjusted to.
        Returns:
        The decoded bitmap.
        Throws:
        java.io.FileNotFoundException - If cannot locate the bitmap's source uri.
      • getBitmapDimensions

        public static Dimensions getBitmapDimensions​(android.content.Context context,
                                                     android.net.Uri uri)
                                              throws java.io.FileNotFoundException
        Get bitmap's dimensions.
        Parameters:
        context - Android context.
        uri - Bitmap's source uri.
        Returns:
        Dimensions of the bitmap.
        Throws:
        java.io.FileNotFoundException - If cannot locate the bitmap's source uri.