Comunidad Gambas-es
Manejando imágenes desde SQLite - Versión para impresión

+- Comunidad Gambas-es (https://gambas-es.org)
+-- Foro: Otros (https://gambas-es.org/forum-18.html)
+--- Foro: Videotutoriales (https://gambas-es.org/forum-20.html)
+--- Tema: Manejando imágenes desde SQLite (/thread-1949.html)



Manejando imágenes desde SQLite - Shordi - 27-04-2025

A petición de un usuario de youtube he hecho este vídeo tutorial de las dos maneras más sencillas de manejar imágenes desde una Base de datos SQLite.



Es un tema un montón de veces tratado, pero siempre puede haber alguien a quien le venga bien.

Saludos


RE: Manejando imágenes desde SQLite - Shell - 29-04-2025

Muy interesante. [Imagen: thumbsup.png]

Puede que te convenga usar probablemente la propiedad Mode del Picturebox.

Cita:PictureBox.Normal The picture is displayed at it’s original size. No attempt is made to fit the picture to the size of the PictureBox.

PictureBox.Fill The picture is stretched to fit both the width and height of the PictureBox. Proportionality of the picture is not maintained.

PictureBox.Cover The picture proportionality is maintained. The entire PictureBox height and width is filled.

PictureBox.Contain The picture proportionality is maintained. The entire picture is displayed and stretched for best fit.

PictureBox.Repeat The picture is displayed at it’s original size and repeated. The entire PictureBox height and width is filled.

Asignale la constante que más te convenga a la propiedad Mode del Picturebox.

Ejemplo:

Cita:
Código:
Public Sub foto_Change()

  Dim proporcion As Float
  Dim pic As Picture
  Dim tmp As String

  If Not foto.text Then Return
  tmp = File.Dir(Temp())
  File.Save(tmp &/ alias.Text & ".jpeg", UnBase64(foto.Text))
  pic = Picture.Load(tmp &/ alias.Text & ".jpeg")
  pbfoto.Mode = PictureBox.Contain
  pbfoto.Picture = pic

  'proporcion = pic.Width / pic.Height
  'pbFoto.Picture = pic.Stretch(Round(proporcion * pbFoto.h), pbfoto.H)
  Wait 0.01

End

Saludos


RE: Manejando imágenes desde SQLite - Shordi - 30-04-2025

Sí señor. No recordé esa propiedad en su momento. Sólo la strech que deformaba la imagen.
Es lo bueno de compartir código, siempre se aprende algo.