use of android.graphics.Picture in project AndEngine by nicolasgramlich.
the class PictureBitmapTextureAtlasSource method onLoadBitmap.
// ===========================================================
// Getter & Setter
// ===========================================================
// ===========================================================
// Methods for/from SuperClass/Interfaces
// ===========================================================
@Override
public Bitmap onLoadBitmap(final Config pBitmapConfig) {
final Picture picture = this.mPicture;
if (picture == null) {
Debug.e("Failed loading Bitmap in " + this.getClass().getSimpleName() + ".");
return null;
}
final Bitmap bitmap = Bitmap.createBitmap(this.mTextureWidth, this.mTextureHeight, pBitmapConfig);
final Canvas canvas = new Canvas(bitmap);
final float scaleX = (float) this.mTextureWidth / this.mPicture.getWidth();
final float scaleY = (float) this.mTextureHeight / this.mPicture.getHeight();
canvas.scale(scaleX, scaleY, 0, 0);
picture.draw(canvas);
return bitmap;
}
use of android.graphics.Picture in project robolectric by robolectric.
the class ShadowPictureTest method copyConstructor.
@Test
public void copyConstructor() {
Picture originalPicture = new Picture();
originalPicture.beginRecording(100, 100);
Picture copiedPicture = new Picture(originalPicture);
assertThat(copiedPicture.getHeight()).isEqualTo(100);
assertThat(copiedPicture.getWidth()).isEqualTo(100);
}
use of android.graphics.Picture in project robolectric by robolectric.
the class ShadowPictureTest method beginRecordingSetsHeightAndWidth.
@Test
public void beginRecordingSetsHeightAndWidth() {
Picture picture = new Picture();
picture.beginRecording(100, 100);
assertThat(picture.getHeight()).isEqualTo(100);
assertThat(picture.getWidth()).isEqualTo(100);
}
use of android.graphics.Picture in project androidquery by androidquery.
the class WebImage method delaySetup.
private void delaySetup() {
wv.setPictureListener(new PictureListener() {
@Override
public void onNewPicture(WebView view, Picture picture) {
wv.setPictureListener(null);
setup();
}
});
//wv.setInitialScale(100);
wv.loadData("<html></html>", "text/html", "utf-8");
wv.setBackgroundColor(color);
}
use of android.graphics.Picture in project cordova-android-chromeview by thedracle.
the class Purity method checkRenderView.
public boolean checkRenderView(WebView view) {
if (state == null) {
setBitmap(view);
return false;
} else {
Picture p = view.capturePicture();
Bitmap newState = Bitmap.createBitmap(p.getWidth(), p.getHeight(), Bitmap.Config.ARGB_8888);
boolean result = newState.equals(state);
newState.recycle();
return result;
}
}
Aggregations