Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I tried this and it worked: private class BitmapProvider implements CurlView.BitmapProvider {</p> <pre><code> private int[] mBitmapIds = {}; public void setImageList( int[] value ) { mBitmapIds = value; } public BitmapDrawable writeOnDrawable( int drawableId, String text, int x, int y, int width ) { Bitmap bitmap = BitmapFactory.decodeResource( getResources(), drawableId ).copy( Bitmap.Config.ARGB_8888, true ); Bitmap newBitmap = Bitmap.createBitmap( bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888 ); Canvas canvas = new Canvas( newBitmap ); canvas.drawBitmap( bitmap, new Matrix(), null); if( text != "" ){ TextView tv = new TextView( getApplicationContext() ); tv.setText( text ); tv.setTextColor( 0xa00050ff ); tv.setTextSize( 24 ); tv.setTypeface( typeface ); Bitmap txtBitmap = Bitmap.createBitmap( width, 768, Bitmap.Config.ARGB_8888 ); Canvas c = new Canvas( txtBitmap ); tv.layout( 0, 0, width, 300 ); tv.draw( c ); canvas.drawBitmap( txtBitmap, x, y, null ); } return new BitmapDrawable( newBitmap ); } //@Override public Bitmap getBitmap( int width, int height, int index ) { BitmapDrawable drawable; Page currentPage = getCurrentPage( index ); if( currentPage.getText() != null ){ drawable = writeOnDrawable( mBitmapIds[ index ] , currentPage.getText(), currentPage.getTextFieldX(), currentPage.getTextFieldY(), currentPage.getTextFieldWidth() ); } else { drawable = writeOnDrawable( mBitmapIds[ index ] , "", currentPage.getTextFieldX(), currentPage.getTextFieldY(), currentPage.getTextFieldWidth() ); } Bitmap bitmap = drawable.getBitmap(); return bitmap; } //@Override public int getBitmapCount() { return mBitmapIds.length; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload