To run an example on android to use PinchZoom I found the following example. I was able to write a working example code which shows the View from the example - but it is all white! How can I use an actual image in this example?
I tried the following in the activity-xml:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:orientation="vertical" >
<com.example.alexander.capycoding_pinchzoom.CanvasView
android:id="@+id/signature_canvas"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/image"
android:textColor="#FFFFFF" />
</FrameLayout>
to use an actual non-white image, but it does not work. (I also renamed the class from ZoomableImageView
to CanvasView
).
Maybe there is another/better example on how to make PinchZoom workable on a Canvas/Bitmap
in android?