Creates a PAGImage object from an android.graphics.Bitmap object, return null if it's not valid Bitmap.
(Bitmap bitmap)
| 18 | * valid Bitmap. |
| 19 | */ |
| 20 | public static PAGImage FromBitmap(Bitmap bitmap) { |
| 21 | if (bitmap != null && bitmap.getConfig() == Bitmap.Config.ARGB_4444) { |
| 22 | bitmap = bitmap.copy(Bitmap.Config.ARGB_8888, false); |
| 23 | } |
| 24 | long context = LoadFromBitmap(bitmap); |
| 25 | if (context == 0) { |
| 26 | return null; |
| 27 | } |
| 28 | return new PAGImage(context); |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Creates a PAGImage object from a path of a image file, return null if the file does not exist |
no test coverage detected