Call DrawIcon(Picture1.hDC, 0, 0, hPicture)
Aleksej писал(а):Попробуй так:
- Код: Выделить всё
Call DrawIcon(Picture1.hDC, 0, 0, hPicture)
Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (PicDesc As PicBmp, RefIID As GUID, ByVal fPictureOwnsHandle As Long, IPic As stdpicture) As Long
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(7) As Byte
End Type
Private Type PicBmp
Size As Long
Type As Long
hBmp As Long
hPal As Long
Reserved As Long
End Type
Function PictureFromHandle(ByVal hBmp As Long, ByVal hPal As Long) As StdPicture
Dim Pic As PicBmp, IID_IDispatch As GUID
With IID_IDispatch
.Data1 = &H20400
.Data4(0) = &HC0
.Data4(7) = &H46
End With
With Pic
.Size = Len(Pic) ' Length of structure
.Type = vbPicTypeBitmap ' Type of Picture (bitmap)
.hBmp = hBmp ' Handle to bitmap
.hPal = hPal ' Handle to palette (may be null)
End With
OleCreatePictureIndirect Pic, IID_IDispatch, 1, PictureFromHandle
End Function
Сейчас этот форум просматривают: Google-бот, Yandex-бот и гости: 95