0

Does setScalX and setScaleY uses the matrix operations to achieve their goal? I know what it does but I am not sure how it works

Thank you

Snake
  • 14,228
  • 27
  • 117
  • 250
  • 2
    http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.1_r1/android/view/View.java#View.setScaleY%28float%29 – Blackbelt Mar 05 '15 at 15:10
  • why do you need to know the implementation details? – pskink Mar 05 '15 at 15:29
  • Because I use it for the purpose of zooming my container and its children when scale gesture is detected. I see lots of posts talking about zooming using matrix (complicated code sometimes). So I wanted to know if I should be using matrix or if the setScale Already does that for me – Snake Mar 05 '15 at 15:46
  • Matrix definitely make it simple, see my answer here: http://stackoverflow.com/a/21657145/2252830 – pskink Mar 05 '15 at 15:56
  • SetScale makes it simpler :).. But really, the problem with your suggested solution is that it does it for the canvas ( specific view). Where in my case I have layout with many children (image views and buttons) under it and I want all of them to be resized with the zooming. SetScale takes care of that and all what you have to use is pivote and scale – Snake Mar 05 '15 at 16:38
  • 1
    no, setScalex and setScaleY is not simpler, my solution keeps all the stuff (translation, rotation and scale) in one place (the Matrix) what you only need to do is to set your ViewGroup to match the Matrix, i used that Matrix directly by calling Canvas.drawBitmap, you need to do not in Canvas/Bitmap layer but in ViewGroup Layer – pskink Mar 05 '15 at 17:15
  • You are the best @pskink . I upvoted your comment. If you can put it as a solution (elaborating more about the ViewGroup layer for my case as I didn't fully understand it) then I will happily accept it – Snake Mar 05 '15 at 18:03
  • Or if you wish not put it as an answer, then just please explain to me what you mean by "you need to do not in Canvas/Bitmap layer but in ViewGroup Layer" – Snake Mar 05 '15 at 20:51

0 Answers0