Hi William, Check out Canvas.Rotate, Canvas.Translate, Canvas.Restore, Canvas.Save
You can call Canvas.Rotate just before drawing the image and it will be drawn on the rotated canvas. On Mar 23, 10:25 am, William <william.caine...@gmail.com> wrote: > i also have the same problem when I want to flip and image around, i > have to create a new bitmap. is there a way to not have to create a > new bitmap every time: > > renderMatrix.preScale((xFlipPic?-1:1), (yFlipPic?-1:1)); > newbitMap = Bitmap.createBitmap(image, 0, 0, image.getWidth > (),image.getHeight(), renderMatrix, false); > > On Mar 22, 5:19 pm, William <william.caine...@gmail.com> wrote: > > > sorry the code should be > > > Matrix matrix = new Matrix(); > > matrix.postRotate(90); > > > Canvas g = new Canvas(image2); > > > g.drawBitmap( > > Bitmap.createBitmap(image, 0, 0, > > image.getWidth > > (), image.getHeight(), matrix, true) > > , 0, 0, null); > > > On Mar 22, 5:18 pm, William <william.caine...@gmail.com> wrote: > > > > My goal is the draw a bitmap onto another bitmap butrotated90 > > > degress. whats the most efficient way to do that. My current method > > > is as follows which is horribly bad because it creates a new bitmap > > > every time. > > > > //i am taking image and drawing itrotatedonto image2 > > > > Matrix matrix = og.getMatrix(); > > > matrix.postRotate(90); > > > > Canvas g = new Canvas(image2); > > > > g.drawBitmap( > > > Bitmap.createBitmap(image, 0, 0, > > > image.getWidth > > > (), image.getHeight(), matrix, true) > > > , 0, 0, null); > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---