Questions tagged [drawbitmap]

68 questions
0
votes
1 answer

Android drawBitmap paint

i am trying to show bullets when the user touched the screen i am making the bullet here public Projectile(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); paint = new Paint(); …
NoobMe
  • 544
  • 2
  • 6
  • 26
0
votes
0 answers

Can drawBitmap throw ArrayIndexOutOfBoundsException?

The faulty part of my code: System.out.println(frame + ", " + ((frame / 10) % 2) + ", " + dyingBoxRelated[1] + ", " + (bad[dyingBoxRelated[1]][0] - radBad) + ", " + (bad[dyingBoxRelated[1]][1] - radBad) + ", "…
rtsketo
  • 1,168
  • 11
  • 18
0
votes
2 answers

drawBitmap nullpointerexception

this is my class.. ı want to use it in my simple game's GameEngine.. but ı didn't understand the problem here.. it doesn't work.. public class Droid { private Bitmap bitmap; private int x; private int y; …
0
votes
0 answers

Problems drawing a bitmap to a rect in android.

I am having trouble with drawing a bitmap to a surfaceview with the canvas.drawBitmap(Bitmap, Rect, Rect, Paint) method. When i put somethign like this: canvas.drawBitmap(square, new Rect(0, 0, 100, 100), new Rect(180, 130, 100, 100), mpaint); it…
Yamil Essus
  • 108
  • 9
0
votes
2 answers

drawBitmap nullpointerexception

I'm experiencing a nullpointerexception in my android java code in the following code. This is inside AndroidGraphics.java. public void drawPixmap(Pixmap pixmap, int x, int y) { canvas.drawBitmap(((AndroidPixmap)pixmap).bitmap, x, y,…
0
votes
1 answer

Displaying all images from a resource folder

I have a folder in my resource folder called "tiles'. I want to be able to add or remove tiles as I develop this game, which could hold hundreds. Therefore - for the map editor I am making - I want a simple way to load these into an array (the…
Brian
  • 35
  • 1
  • 4
0
votes
1 answer

Visual defects when I use drawBitmap()

It looks like this both in the emulator and on the phone. It's always a random square that is broken. And here is the code from the SurfaceView class, the most relevant part is in prepareBackground() : Code begins: public class MenuBackgroundView…
Aron
  • 144
  • 2
  • 11
-1
votes
2 answers

How can we specify the text size, type, density when creating bitmap

I'm trying to create a bitmap with text on it. but I'm having troubles in specifying the options for that text, like the size, type, smoothness. Here is my code: Bitmap resultBitmap=Bitmap.createBitmap(384,384, Bitmap.Config.ARGB_8888); Canvas…
Muayad Salah
  • 701
  • 1
  • 8
  • 19
1 2 3 4
5