Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Rotate Bitmap about his top

Rotate Bitmap about his top

Problems with Canvas, OpenGL, etc...

Rotate Bitmap about his top

Postby Radiance » Sun Jul 17, 2011 12:12 pm

Hi all!
Sorry,my English is bad.
I want rotate my bitmap about his any top.I do it next way:
Code: Select all
                angle = 1.0f;       
         
                bitmap1 = BitmapFactory.decodeResource(getResources(), R.drawable.green);

      protected void onDraw(Canvas canvas)
      {
                         
                        canvas.rotate(scale);
         
         canvas.drawBitmap(bitmap1, 0 , 0 ,null);
            
         angle += 1.0f;
         
         invalidate();
                 
                 }




This good work,but i need get it use Matrix.I do it next way:

Code: Select all

         angle = 1.0f;       
         
         bitmap1 = BitmapFactory.decodeResource(getResources(), R.drawable.green);
         
          protected void onDraw(Canvas canvas)
          {
         
         matrix = new Matrix();
         
         matrix.setRotate(angle, 0 ,0);
         
         bitmap2 = Bitmap.createBitmap(bitmap1, 0, 0,bitmap1.getWidth(),bitmap1.getHeight(), matrix,false);
                  
         canvas.drawBitmap(bitmap2,0,0, null);
               
         angle += 1.0f;
         
         invalidate();
         
      }           
   

This is dont work,like previous example.Bitmep rotating another,Bitmap dont have pivot point.
My problem : How make rotate Bitmap use Matrix,that bitmap rotate about any his point
(for example left top),like first example with rotate canvas.
Radiance
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Jul 17, 2011 11:51 am

Top

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

Who is online

Users browsing this forum: No registered users and 1 guest