Android Question Images not showing transparent.

Discussion in 'Android Questions' started by tufanv, Jul 22, 2015.

  1. tufanv

    tufanv Expert Licensed User

    Hello

    I have a circle image that edges are transparent. But when i load them and add to activity edges also seen and it shows like a square. I am missing stg but what ? any ideas ?

    edit: project added to post number 4 as zip

    TY
     
    Last edited: Jul 22, 2015
  2. ilan

    ilan Expert Licensed User

    Are you loading a png file to an imageview??
    or drawing with canvas??

    if you load that image in designer is it transparent?
     
    Last edited: Jul 22, 2015
  3. tufanv

    tufanv Expert Licensed User

    Hello I am loading a png into imageview . I do not use the designer . I initialize the imageview in the code and than use loadbitmap .
     
  4. tufanv

    tufanv Expert Licensed User

    here is the project atttached. gri.png is a transparent image.
     

    Attached Files:

  5. ilan

    ilan Expert Licensed User

    i don't see any gri.png file in your project
     
  6. tufanv

    tufanv Expert Licensed User

    it is in the files in the zip . I checked it now are you sure ? :)
     
  7. LucaMs

    LucaMs Expert Licensed User

    You should "upload" also that gri.png.

    I used another .png in your project and it works as expected, then your .png does not have the transparency, I think.

    BTW, check your log, it is full of warnings ;)
     
    ilan likes this.
  8. ilan

    ilan Expert Licensed User

    if you do it like this will it work?

    Code:
    For i=0 To 15
            img(i).Initialize(
    "imaj")
            img(i).SetBackgroundImage(
    LoadBitmap(File.DirAssets, "gri.png"))
            img(i).Tag=
    "gri"
            img(i).Gravity = 
    Gravity.FILL
        
    Next

    (btw put your timers in Process_Globals)
     
  9. ilan

    ilan Expert Licensed User

    no images in zip file
     
  10. ilan

    ilan Expert Licensed User

    your file folder on my pc look like this

    screen.jpg

    empty of everything like the desert...
     
  11. tufanv

    tufanv Expert Licensed User

    this is the gri.png
     

    Attached Files:

    • gri.png
      gri.png
      File size:
      5.2 KB
      Views:
      14
  12. tufanv

    tufanv Expert Licensed User

    I have uploaded i seperately now. I will chek your suggested code
     
  13. ilan

    ilan Expert Licensed User

    you can do it in one loop don't need 2 loops for it (intialize and load image in the same loop), and also luca is right, you have lot of warnings you should try to get rid of them by following the tips ;)
     
  14. tufanv

    tufanv Expert Licensed User

    It is because I deleted nearly %90 of the code immigrated from b4i. it works perfect on b4i but the same png not working on b4a.
     
  15. LucaMs

    LucaMs Expert Licensed User

    It is ok and I get the transparence.

    Can you post a screenshot?


    P.S.
     

    Attached Files:

  16. ilan

    ilan Expert Licensed User

    1+
     
  17. tufanv

    tufanv Expert Licensed User

    I dont have my note3 with me now. But i checked it with the emulator it shows the same. this is the ss from the emulator. Yesterday I checked it with note3 5.0 and it was the same on the real device
     

    Attached Files:

    • ss.png
      ss.png
      File size:
      241.4 KB
      Views:
      20
  18. ilan

    ilan Expert Licensed User

    are you using gravity.fill?
     
    LucaMs likes this.
  19. tufanv

    tufanv Expert Licensed User

    I just sended a ss to you with the old code. I tried it wit gravity.fill and it shows ok now thank you ! But i could not understand why Luca see it correctly but i cant
     
  20. LucaMs

    LucaMs Expert Licensed User

    If you used the same project, I can think only to some problems related to the Android version but that would be strange.
     
Loading...