Android Question .9patch, there's a problem with the expansion of the background image. Where's that wrong?

cxdzbl

Active Member
Licensed User
I put the map on the panel, can guarantee that the image without distortion, but the background of serious deformation, please enlighten.

B4X:
SetNinePatchDrawable (Panel, "msgstyle")
Sub SetNinePatchDrawable (Control, As, View, ImageName, As, String)
Dim R As Reflector
Dim package As String
Dim ID As Int
Package = r.GetStaticField ("anywheresoftware.b4a.BA", "packageName")
Id = r.GetStaticField (package &.R$drawable, ImageName)
R.Target = r.GetContext
R.Target = r.RunMethod ("getResources")
Control.Background = r.RunMethod2 ("getDrawable", "Id", "java.lang.int")
End Sub
 

Attachments

  • ){Z4P%HJ2(%W0JQZ}L6NJ_X.png
    ){Z4P%HJ2(%W0JQZ}L6NJ_X.png
    36.1 KB · Views: 237
  • 20170829_215257.png
    20170829_215257.png
    97.3 KB · Views: 250

cxdzbl

Active Member
Licensed User
The problem is that the small triangle can not be fixed, it is the same as the expansion of the size of the expansion, is not a word problem, normal in 9cath, but after the compilation of the operation, the small triangle is not fixed. Take a look at the picture above.
Append:
Just another test of a picture, and found the cause of the problem. The pictures should be smaller than view's height and width to make a difference. Otherwise, there will be errors.
Thank you
 
Last edited:
Upvote 0
Top