Android Question Send imageview1.bitmap to imageview2 bitmap

Douglas Farias

Expert
Licensed User
Longtime User
its possible send a bitmap of my imageview to another imageview?
this image is not on my device is from web and i show this on imageview1
i want to send this image of imageview1 to imageview2 with a click its possible?

i m trying to use this

B4X:
Sub lupaesquerda_Click
        background1 = Sender
        If background1.Background Is BitmapDrawable Then
        Dim bd As BitmapDrawable
        bd = background1.Background
        Dim bmp As Bitmap
        bmp = bd.Bitmap
        End If
        bgfull.Bitmap = bmp   
        bgfull.Visible = True
End Sub

but dont work
i have a imageview with name background1
and i want send the bitmap of background1 to imageview with name bgfull

i put this code in one button lupaesquerda_Click
but when i click send button background to bgfull and not the background1 *-*
 
Last edited:

socialnetis

Active Member
Licensed User
Longtime User
Why don't you just use:
B4X:
Sub lupaesquerda_Click
    bgfull.Bitmap = background1.Bitmap
End Sub

There is a little scope problem with your code:
- If background1.Background Is BitmapDrawable returns False, then the "bmp" variable is never called and is not initialized, so when you do:
bgfull.Bitmap = bmp, you are assigning another "bmp" variable that you initialized in another place.
 
Upvote 0
Top