0

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?

Alex
  • 41,580
  • 88
  • 260
  • 469
  • Easier example which actually works: http://stackoverflow.com/questions/5216658/pinch-zoom-for-custom-view – Alex Dec 16 '16 at 10:41

1 Answers1

0

you are using a default image in the xml.use your image and by the way simply putting xml cannot alone perform the action.i suggest to use library files for the pinch zoom and then create a class for the zoom specification

ArunKumar
  • 1
  • 1