salut tous le monde,
j'en ai écrit ce code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
 
 
Private Sub Command1_Click()
Picture1.PaintPicture Image1.Picture, 0, 0, Picture1.Width, Picture1.Height
    Dim sDC As Long
    Dim path1, path2 As String
    path1 = "c:\image\test.bmp"
    With Picture1
        sDC = .hDC
        BitBlt .hDC, 0, 0, .ScaleWidth, .ScaleHeight, sDC, 0, 0, vbSrcCopy
        SavePicture .Image, path1
    End With
 
End Sub
mais j'obtient comme résultat un fichier contenant le fond du picturebox [une image grise]comment pourai-je faire pour obtenir l'image.
j'en ai déjà lu une solution de ce problème mais je ne me rappelle plus ou ni comment faire.