How to use canvas.drawBitmap()

Problems with Canvas, OpenGL, etc...

How to use canvas.drawBitmap()

Postby rjuy » Mon Nov 15, 2010 2:22 am

Hello!

I'm currently having an error when running this code.

Code: Select all
@Override
   protected void onDraw(Canvas canvas) {
      
      Paint background = new Paint();
      Paint forCircle = new Paint();
     
      forCircle.setColor(color);

      background.setColor(getResources().getColor(
            R.color.puzzle_background));

      Bitmap mBitmap = BitmapFactory.decodeResource(getResources(),R.drawable.icon);
      canvas.drawBitmap(mBitmap, null, forCircle);
    ]


the main program is not attached in here, but the code above was triggered when I click draw button.

thanks a lot!

-rjuy
rjuy
Experienced Developer
Experienced Developer
 
Posts: 52
Joined: Mon Oct 25, 2010 2:38 am

Top

Re: How to use canvas.drawBitmap()

Postby Schermvlieger » Mon Nov 15, 2010 9:12 am

Hi rjuy,

You really need to take a look at logcat to see what is causing your error; Even if after looking at logcat you have no clue whay is causing the error, it will help us help you if you provide the logcat information in your posts.
Schermvlieger
Senior Developer
Senior Developer
 
Posts: 159
Joined: Fri Feb 26, 2010 1:37 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 3 guests