Package org.robolectric.shadows
Class ShadowBitmapFactory
java.lang.Object
org.robolectric.shadows.ShadowBitmapFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static BitmapdecodeByteArray(byte[] data, int offset, int length) protected static BitmapdecodeByteArray(byte[] data, int offset, int length, BitmapFactory.Options opts) protected static BitmapdecodeFile(String pathName) protected static BitmapdecodeFile(String pathName, BitmapFactory.Options options) protected static BitmapdecodeFileDescriptor(FileDescriptor fd, Rect outPadding, BitmapFactory.Options opts) protected static BitmapdecodeResource(Resources res, int id, BitmapFactory.Options options) protected static BitmapdecodeResourceStream(Resources res, TypedValue value, InputStream is, Rect pad, BitmapFactory.Options opts) protected static Bitmapprotected static BitmapdecodeStream(InputStream is, Rect outPadding, BitmapFactory.Options opts) static voidprovideWidthAndHeightHints(int resourceId, int width, int height) Deprecated.Use any of the BitmapFactory.decode methods with real image data.static voidprovideWidthAndHeightHints(Uri uri, int width, int height) Deprecated.Use any of the BitmapFactory.decode methods with real image data.static voidprovideWidthAndHeightHints(FileDescriptor fd, int width, int height) Deprecated.Use any of the BitmapFactory.decode methods with real image data.static voidprovideWidthAndHeightHints(String file, int width, int height) Deprecated.Use any of the BitmapFactory.decode methods with real image data.static voidreset()static voidsetAllowInvalidImageData(boolean allowInvalidImageData) Whether the BitmapFactory.decode methods, such asBitmapFactory.decodeStream(InputStream, Rect, Options)should allow invalid image data and always return Bitmap objects.
-
Constructor Details
-
ShadowBitmapFactory
public ShadowBitmapFactory()
-
-
Method Details
-
decodeResourceStream
@Implementation protected static Bitmap decodeResourceStream(Resources res, TypedValue value, InputStream is, Rect pad, BitmapFactory.Options opts) -
decodeResource
@Implementation protected static Bitmap decodeResource(Resources res, int id, BitmapFactory.Options options) -
decodeFile
-
decodeFile
-
decodeFileDescriptor
@Implementation protected static Bitmap decodeFileDescriptor(FileDescriptor fd, Rect outPadding, BitmapFactory.Options opts) -
decodeStream
-
decodeStream
@Implementation protected static Bitmap decodeStream(InputStream is, Rect outPadding, BitmapFactory.Options opts) -
decodeByteArray
-
decodeByteArray
@Implementation protected static Bitmap decodeByteArray(byte[] data, int offset, int length, BitmapFactory.Options opts) -
provideWidthAndHeightHints
Deprecated.Use any of the BitmapFactory.decode methods with real image data. -
provideWidthAndHeightHints
Deprecated.Use any of the BitmapFactory.decode methods with real image data. -
provideWidthAndHeightHints
Deprecated.Use any of the BitmapFactory.decode methods with real image data. -
provideWidthAndHeightHints
Deprecated.Use any of the BitmapFactory.decode methods with real image data. -
reset
-
setAllowInvalidImageData
public static void setAllowInvalidImageData(boolean allowInvalidImageData) Whether the BitmapFactory.decode methods, such asBitmapFactory.decodeStream(InputStream, Rect, Options)should allow invalid image data and always return Bitmap objects. If set to false, BitmapFactory.decode methods will be consistent with real Android, and return null Bitmap values and setBitmapFactory.Options.outWidthandBitmapFactory.Options.outHeightto -1.- Parameters:
allowInvalidImageData- whether invalid bitmap data is allowed and BitmapFactory should always return Bitmap objects.
-