No puedo subir una imagen de la galería móvil. si puedo hacerlo con una imagen descargada de google. ¿Será por el formato o la calidad de la imagen?
Código utilizado:
[CODE lang = "b4x" title = "B4X"] Sub ImageViewIU_Click
ImageChooser.Initialize ("imgChooser")
ImageChooser.Show ("imagen / *", "Elegir imagen")
End Sub
Sub imgChooser_Result (Correcto como booleano, Dir como cadena, Nombre de archivo como cadena)
Si tiene éxito, entonces
Dim b como mapa de bits
b.Inicializar (Dir, Nombre de archivo)
ImageViewIU.Bitmap = b
ImageViewIU.Top = t
ImageViewIU.Width = w
ImageViewIU.Height = h
Dim Delta, altura, ancho como int
Si b.Width / b.Height> ImageViewIU.Width / ImageViewIU.Height Entonces
Alto = b.Height / b.Width * ImageViewIU.Width
Delta = (ImageViewIU.Height - Height) / 2
ImageViewIU.Height = Altura
ImageViewIU.Top = ImageViewIU.Top + Delta
Más
Ancho = b.Width / b.Height * ImageViewIU.Height
Delta = (ImageViewIU.Width - Width) / 2
ImageViewIU.Width = Ancho
ImageViewIU.Left = ImageViewIU.Left + Delta
Terminara si
Más
ToastMessageShow ("No ha seleccionado ninguna imagen", True)
Terminara si
End Sub [/ CODE]
Código utilizado:
[CODE lang = "b4x" title = "B4X"] Sub ImageViewIU_Click
ImageChooser.Initialize ("imgChooser")
ImageChooser.Show ("imagen / *", "Elegir imagen")
End Sub
Sub imgChooser_Result (Correcto como booleano, Dir como cadena, Nombre de archivo como cadena)
Si tiene éxito, entonces
Dim b como mapa de bits
b.Inicializar (Dir, Nombre de archivo)
ImageViewIU.Bitmap = b
ImageViewIU.Top = t
ImageViewIU.Width = w
ImageViewIU.Height = h
Dim Delta, altura, ancho como int
Si b.Width / b.Height> ImageViewIU.Width / ImageViewIU.Height Entonces
Alto = b.Height / b.Width * ImageViewIU.Width
Delta = (ImageViewIU.Height - Height) / 2
ImageViewIU.Height = Altura
ImageViewIU.Top = ImageViewIU.Top + Delta
Más
Ancho = b.Width / b.Height * ImageViewIU.Height
Delta = (ImageViewIU.Width - Width) / 2
ImageViewIU.Width = Ancho
ImageViewIU.Left = ImageViewIU.Left + Delta
Terminara si
Más
ToastMessageShow ("No ha seleccionado ninguna imagen", True)
Terminara si
End Sub [/ CODE]