11. april 2003 - 11:43
Der er
4 kommentarer
billede i picturebox
Hejsa Hvordan skalere jeg mit billede i min picturebox ned, så det passer med pictureboxen´s størrelse. jeg har prøvet følgene: Picture1.Picture = LoadPicture("c:\test.bmp", , , "100", "100") //billede bliv vist men ikke 100x100 Picture1.Picture.Height = 100 //kommer med en fejl Hvad gør jeg forkert?? Royal12
Annonceindlæg fra Infor
11. april 2003 - 12:52
#1
Option Explicit Private Sub Form_Load() Dim strPath As String Dim lHeight As Long Dim lWidth As Long strPath = "c:\test.bmp" lWidth = 100 lHeight = 100 With Picture1 .AutoRedraw = True .AutoSize = True .ScaleMode = vbPixels .PaintPicture LoadPicture(strPath), 0, 0, lWidth, lHeight End With End Sub
11. april 2003 - 12:59
#2
fejl med AutoSize virker ikke. :-) Option Explicit Private Sub Form_Load() Dim strPath As String Dim lHeight As Long Dim lWidth As Long strPath = "c:\test.bmp" lWidth = 100 lHeight = 100 With Picture1 .AutoRedraw = True .ScaleMode = vbPixels .PaintPicture LoadPicture(strPath), 0, 0, lWidth, lHeight .Width = (lWidth * Screen.TwipsPerPixelY) .Height = (lHeight * Screen.TwipsPerPixelY) End With End Sub
11. april 2003 - 13:07
#3
det er vist ikke min dag i dag :-) Option Explicit Private Sub Form_Load() Dim strPath As String Dim lHeight As Long Dim lWidth As Long strPath = "c:\test.bmp" lWidth = 100 lHeight = 100 With Picture1 .AutoRedraw = True .ScaleMode = vbPixels .PaintPicture LoadPicture(strPath), 0, 0, lWidth, lHeight .Width = (lWidth * Screen.TwipsPerPixelX) .Height = (lHeight * Screen.TwipsPerPixelY) End With End Sub