I have layout in that it contain a horizontal scroll scale.
My question is how make this type of zoom effect on the center of the layout? Is it possible? i have draw the scale in canvas and zoom the canvas??
Please help me. Thank's in advance.
I have layout in that it contain a horizontal scroll scale.
My question is how make this type of zoom effect on the center of the layout? Is it possible? i have draw the scale in canvas and zoom the canvas??
Please help me. Thank's in advance.
I think you want a Transformation: http://developer.android.com/reference/android/view/animation/Transformation.html
The code in your onDraw method will look something like this:
canvas.save();
transformation.transform(canvas);
drawable.draw(canvas);
canvas.restore();
Step 1: At first draw the scale(drawing) on a canvas.
Step 2: get the zooming region, and apply this region as the clipRegion on the canvas ..
Step 3: get the bitmap from the canvas, and draw it on the canvas applying scale on it,scaling pivot point will be the center point of the area you want to zoom,
Bitmap.Config conf = Bitmap.Config.ARGB_8888;
Bitmap bitmap_object = Bitmap.createBitmap(width, height, conf);
Canvas canvas_object = new Canvas(bitmap_object);
/* now draw your drawing on canvas_object */
Bitmap temp = bitmap_object;
Matrix matrix_object = new Matrix();
/* now set transform and scale on matrix_object to zoom */
Paint paint_object = new Paint();
paint_object.setFilterBitmap(true);
Region reg= /* region of your zooming area */
canvas_object.clipRegion(reg);
canvas_object.drawBitmap(temp,matrix_object,paint_object);