Shordi   27-04-2025, 17:43
#1
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

No podemos regresar
Shell   Ayer, 22:49
#2
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
Última modificación: Hace 11 horas por Shell.

"El conocimiento es la mejor inversión que se puede hacer" - Abraham Lincoln
Shordi   Hace 4 horas
#3
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.

No podemos regresar
  
Usuarios navegando en este tema: 1 invitado(s)
Powered By MyBB, © 2002-2025 MyBB Group.
Made with by Curves UI.