Italian [risolto diversamente] B4J event click imageview

ivanomonti

Expert
Licensed User
Longtime User
stavo sistemando la sezione foto con piccola listview che mi da anteprima delle foto nell'interno della folder photo, ma al suo click non si scatena evento,,, mi chiedo se sbaglio qualcosa, allego foto e codice

B4X:
public Sub loadImage () As Boolean

            Dim path As String = File.Combine(File.dirApp,File.Combine("_Archive",Main.idlogin))
            path = File.Combine(path,"Photo")
            
            For i = 0 To File.ListFiles(path).Size-1
                Dim imgw As ImageView
                Dim imgTemp As Image
                imgTemp.InitializeSample(path,File.ListFiles(path).Get(i),64,64)
                imgw.Initialize("xxx")
                imgw.SetImage(imgTemp)
                mbaselist.Items.Add(imgw)
            Next

    Return True

End Sub

Sub xxx_MouseClicked (EventData As MouseEvent)
    Dim imgw As ImageView = Sender
    viewscale(imgw.GetImage,View)
End Sub

Sub xxx_MousePressed (EventData As MouseEvent)
    Log(EventData.ClickCount)
End Sub

Sub xxx_MouseReleased (EventData As MouseEvent)
    Log(EventData.ClickCount)
End Sub

 

ivanomonti

Expert
Licensed User
Longtime User
ho cambiato codice intercettando quello della listview 2 righe in più di codice


B4X:
Sub xxx_MouseClicked (EventData As MouseEvent)
    Dim listViewTemp As ListView = Sender
    Dim imgw As ImageView = listViewTemp.Items.Get(listViewTemp.SelectedIndex)
    Dim bmp As B4XBitmap = Main. xui.LoadBitmap(imgw.Tag,"")
    rec.Initialize(0,0,View.Width,View.Height)
    viewscale(bmp,View)
    LBNamefile.Text = imgw.Tag
End Sub

 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…