0

I am new in Android and I want to make zoom out and zoom in on canvas or bitmap. I made draw app and than i want to make zoom out and zoom in picture which I have drawn. Can any one suggest me?

I want to zoom:

private Bitmap mBitmap;
private Canvas mCanvas;

How do I make "layer drawing"?

Rajesh
  • 15,724
  • 7
  • 46
  • 95
  • It's not really clear exactly what you want to do. Would it work to use Canvas.scale() method before you painted your bitmap on it? – Albin Sep 19 '12 at 08:49
  • there are many examples out there for what you want to make. You have to create a custom view that draws the bitmap and then mess with scale and translate. I googled and found this http://android-er.blogspot.in/2010/07/skew-bitmap-image-using-matrix.html – weakwire Sep 19 '12 at 08:56
  • i saw that but i dont need this. I want prass with two fingers and i want move it together than my picture wich i draw make bigger or make smaller –  Sep 19 '12 at 09:03
  • then search for pinch to zoom android example or something.I don't think anyone will give you a full working example. Just references clues or solution to specific problems – weakwire Sep 19 '12 at 09:14
  • yes i know .. but i saw this : http://stackoverflow.com/questions/2537238/how-can-i-get-zoom-functionality-for-images –  Sep 19 '12 at 09:55
  • But i dont know if it is useful for me or not ? –  Sep 19 '12 at 09:55

1 Answers1

0

use Canvas api

scale(float sx, float sy)
    Preconcat the current matrix with the specified scale.

drawBitmap(int[] colors, int offset, int stride, float x, float y, int width, int height, boolean hasAlpha, Paint paint)
    Treat the specified array of colors as a bitmap, and draw it.
Mike Wei
  • 337
  • 2
  • 6