Questions tagged [bitmapshader]

8 questions
4
votes
0 answers

How would I stretch a Bitmap Shader as opposed to tiling it?

In a game that I and another classmate of mine are working on, our barriers have the following code to assign a texture and a color to our canvas objects: paintColor = new Paint(); Bitmap bitmap =…
Stephen
  • 41
  • 3
4
votes
0 answers

BitmapShader shows black background instead of bitmap

In My app, I use a bitmap shader in order to create a round profile image, this works well, however in the Asus Padfone Infinity it renders as a black circle. attached the code snippet from my custom ImageView: circularBitmapShader = new…
Israel Tabadi
  • 574
  • 4
  • 11
3
votes
1 answer

How to keep BitmapShader not drawing outside the image

I have a custom view that is showing an image inside a shape. I used BitmapShader to fit my image into the shape with TileMode is CLAMP Now I have a problem that when I am moving my image (using setLocalMatrix method) it make my image become…
Newbie
  • 41
  • 3
1
vote
1 answer

Recycle the Bitmap of a BitmapShader

What would be the correct (recommended) way to recycle/release the bitmap of a BitmapShader? Should we keep a reference of the bitmap and once the BitmapShader is no longer in use then to call bitmap.recycle()? Looking at the BitmapShader source,…
PerracoLabs
  • 16,449
  • 15
  • 74
  • 127
0
votes
0 answers

Android Bitmapshader separating the colors of a two-color bitmap

I have created a bitmap that I want to use for a BitmapShader. The bitmap and the result after using it with a BitmapShader and a paint object looks as follows: Ignore the word 'new game' on the left picture. The bitmap does not have that word in…
i_o
  • 777
  • 9
  • 25
0
votes
1 answer

Draw Bitmap on an circle with BitmapShader

paint[1].setShader( new BitmapShader( BitmapFactory.decodeResource( getResources(), R.drawable.skin_), Shader.TileMode.REPEAT, Shader.TileMode.REPEAT)); paint.getShader().setLocalMatrix(M); canvas.drawCircle( C.x, C.y, Size , paint[1]); I…
0
votes
0 answers

Draw Emoji on canvas using BitmapShader

I'm trying to draw emoji, whenever I touch the screen, I'm using setShader method and BitmapShader to make it but the code below gives this : public class MainActivity extends Activity implements View.OnTouchListener{ float downx = 0; …
-1
votes
1 answer

Out of memory exception occurred at Bitmap Shadder android

I am working on android application in which i am using Bitmap, but the problem is that sometimes it shows me an error of out of memory and my application get crashed. I am using bitmaps along with BitmapShadder, my code is given below where my…
Usman Khan
  • 3,739
  • 6
  • 41
  • 89