TrisectDevelopment Active Member Licensed User Longtime User May 1, 2011 #1 I have made an app that take a photo with the camera and displays it iun an imageview. The camera part works okay and the images get saved as a JPG file. BUT when I try to load the saved image into my imageview something is not working. I see only a part of the picture saved(taken)... I read something on this forum about using a canvas but I cannot figure out what it is I'm supposed to do. Can anyone provide me with some code examples on how to do it or help me in another way?? Thanks in advance!
I have made an app that take a photo with the camera and displays it iun an imageview. The camera part works okay and the images get saved as a JPG file. BUT when I try to load the saved image into my imageview something is not working. I see only a part of the picture saved(taken)... I read something on this forum about using a canvas but I cannot figure out what it is I'm supposed to do. Can anyone provide me with some code examples on how to do it or help me in another way?? Thanks in advance!
TrisectDevelopment Active Member Licensed User Longtime User May 2, 2011 #2 Is there really no one who can help? Upvote 0
I Inman Well-Known Member Licensed User Longtime User May 2, 2011 #3 Instead of setting the bitmap with Imageview.Bitmap=, try using Imageview.background=bd. Of course first you need to Dim bd as BitmapDrawable and then bd.Initialize with the JPG you took from camera. Then only set Imageview.background=bd Upvote 0
Instead of setting the bitmap with Imageview.Bitmap=, try using Imageview.background=bd. Of course first you need to Dim bd as BitmapDrawable and then bd.Initialize with the JPG you took from camera. Then only set Imageview.background=bd
Erel B4X founder Staff member Licensed User Longtime User May 3, 2011 #4 Make sure to set the ImageView gravity property to Gravity.Fill: Code: iv.Gravity = Gravity.Fill Upvote 0
TrisectDevelopment Active Member Licensed User Longtime User May 3, 2011 #5 #Inman: Thanks that did helped. #Erel: I did that in the designer. Upvote 0
D dlfallen Active Member Licensed User Longtime User May 3, 2011 #6 Setting gravity=fill in the designor does not help. You need to do it in code, as Erel suggested. For a more complete explination see this thread: http://www.b4x.com/forum/bugs-wishlist/7652-odd-imageview-behavior.html My preferences, stated at the end of that thread still stand. You probably won't be the last to check gravity=fill in the designer and be surprised when a newly loaded image is displayed otherwise. Upvote 0
Setting gravity=fill in the designor does not help. You need to do it in code, as Erel suggested. For a more complete explination see this thread: http://www.b4x.com/forum/bugs-wishlist/7652-odd-imageview-behavior.html My preferences, stated at the end of that thread still stand. You probably won't be the last to check gravity=fill in the designer and be surprised when a newly loaded image is displayed otherwise.