
org.robolectric.shadows.ShadowPicture Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of framework Show documentation
Show all versions of framework Show documentation
An alternative Android testing framework.
The newest version!
package org.robolectric.shadows;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Picture;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
@Implements(Picture.class)
public class ShadowPicture {
private int width;
private int height;
public void __constructor__() {
}
public void __constructor__(long nativePicture) {
}
public void __constructor__(int nativePicture, boolean fromStream) {
}
public void __constructor__(Picture src) {
width = src.getWidth();
height = src.getHeight();
}
@Implementation
public int getWidth() {
return width;
}
@Implementation
public int getHeight() {
return height;
}
@Implementation
public Canvas beginRecording(int width, int height) {
this.width = width;
this.height = height;
return new Canvas(Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy