Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Type PICTDESC cbSize As Long pictType As Long hIcon As Long hPal As Long End Type Private Declare Function OleCreatePictureIndirect Lib "olepro32.dll" _ (lpPictDesc As PICTDESC, riid As Any, ByVal fOwn As Long, _ ipic As IPicture) As Long Function IconToPicture(ByVal hIcon As Long) As Picture Dim pic As PICTDESC Dim guid(0 To 3) As Long ' initialize the PictDesc structure pic.cbSize = Len(pic) pic.pictType = vbPicTypeIcon pic.hIcon = hIcon ' this is the IPicture GUID {7BF80980-BF32-101A-8BBB-00AA00300CAB} ' we use an array of Long to initialize it faster guid(0) = &H7BF80980 guid(1) = &H101ABF32 guid(2) = &HAA00BB8B guid(3) = &HAB0C3000 ' create the picture, ' return an object reference right into the function result OleCreatePictureIndirect pic, guid(0), True, IconToPicture End Function toto = SelectObject(hdc, VideoCap1.SnapShot2HBITMAP) Dim mastd As StdPicture mastd = IconToPicture(toto)
Dim toto As Long toto = SelectObject(hdc, VideoCap1.SnapShot2HBITMAP) Dim mastd As StdPicture Set mastd = IconToPicture(toto) Dim c As Long c = GetPixel(toto, 100, 100) Label5.Caption = c