Dim sz As Size = Image.FromFile("blabla.jpg").Size 'sz.Width et sz.Height te donneront tes dimensions.
msgbox loadpicture("d:\bateau.bmp").height msgbox loadpicture("d:\bateau.bmp").width
dim toto As new bitmap("d:\bateau.bmp") msgbox toto.height & " " & toto.width
' Donne la hauteur dune image (code par Lyc@n/LycanOSX) Function PictureHeight(path As String) Dim tempPictureBox As New PictureBox tempPictureBox.Image = Image.FromFile(path) tempPictureBox.SizeMode = PictureBoxSizeMode.AutoSize Return tempPictureBox.Image.Height tempPictureBox = Nothing End Function
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Function GetImageHeight(ByVal path As String) As Integer Dim bt As Bitmap bt = DirectCast(Image.FromFile(path), Bitmap) Return bt.Height End Function