Android Question Images not showing transparent.

tufanv

Expert
Licensed User
Longtime 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:

ilan

Expert
Licensed User
Longtime 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:
Upvote 0

tufanv

Expert
Licensed User
Longtime 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 .
You are loading a png file to an imageview??
or drawing with canvas??

if you load that image in designer is it transparent?
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
here is the project atttached. gri.png is a transparent image.
 

Attachments

  • project.zip
    5 KB · Views: 152
Upvote 0

ilan

Expert
Licensed User
Longtime User
if you do it like this will it work?

B4X:
    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)
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
your file folder on my pc look like this

screen.jpg


empty of everything like the desert...
 
Upvote 0

tufanv

Expert
Licensed User
Longtime 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 ;)

this is the gri.png
 

Attachments

  • gri.png
    gri.png
    5.2 KB · Views: 146
Upvote 0

ilan

Expert
Licensed User
Longtime 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 ;)
 
Upvote 0

tufanv

Expert
Licensed User
Longtime 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 ;)

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.
 
Upvote 0

tufanv

Expert
Licensed User
Longtime 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
 

Attachments

  • ss.png
    ss.png
    241.4 KB · Views: 206
Upvote 0

ilan

Expert
Licensed User
Longtime 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

are you using gravity.fill?
 
Upvote 0
Top