iOS Question Barbutton image color

Discussion in 'iOS Questions' started by mrossen, Mar 29, 2015.

  1. mrossen

    mrossen Active Member Licensed User

    How do I keep the colors for the image I use in bar button

    I know how to change it with:

    Code:
    Dim b1 As BarButton
        b1.InitializeBitmap(
    LoadBitmap(File.DirAssets, "cruise.png"), "btn_cruise")
        b1.TintColor = 
    Colors.RGB(127,176,0)
        Page1.TopLeftButtons = 
    Array(b1)
    But how can I keep the original colors.

    If I dont use "b1.TintColor" the image went IOS blue

    Mogens
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Add this sub:
    Code:
    Sub KeepOriginalColors(bmp As BitmapAs Bitmap
       
    Dim no As NativeObject = bmp
       
    Return no.RunMethod("imageWithRenderingMode:"Array(1))
    End Sub
    Change your code to:
    Code:
    b1.InitializeBitmap(KeepOriginalColors(LoadBitmap(...)), "btn_cruise")
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice