Hello,
I want to use the "translate" or "scale" on Canvas using JavaObject but is not working ... the "drawPath" method is working. (https://developer.android.com/reference/android/graphics/Canvas.html)
Any ideas why?
This is the example code:
I want to use the "translate" or "scale" on Canvas using JavaObject but is not working ... the "drawPath" method is working. (https://developer.android.com/reference/android/graphics/Canvas.html)
Any ideas why?
This is the example code:
B4X:
'myPath and myCanvas need to exist
Dim Paint, CanvJO, FillStyle As JavaObject
CanvJO = myCanvas
CanvJO = CanvJO.GetField("canvas")
Paint.InitializeNewInstance("android.graphics.Paint",Null)
Paint.RunMethod("setAntiAlias", Array As Object(True))
Paint.RunMethod("setColor", Array As Object(Colors.Blue))
FillStyle.InitializeStatic("android.graphics.Paint.Style")
Paint.RunMethod("setStyle", Array As Object(FillStyle.RunMethod("valueOf", Array("FILL"))))
CanvJO.RunMethod("translate", Array As Object(10,10)) 'This is not working! Why?
CanvJO.RunMethod("scale", Array As Object(1,-1,50,50)) 'This is not working! Why?
CanvJO.RunMethod("drawPath", Array As Object(myPath,Paint)) 'This is working.