Dim i As prjGDIplus.Image
Set i = CreateImageFromMemory(Data())
Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As Long
Private Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (ByVal hInst As Long, ByVal lpIconPath As String, lpiIcon As Long) As Long
Sub Form_Load()
dim a as long
a = ExtractAssociatedIcon(me.hwnd,"C:\WINDOWS\system32\calc.exe",1)
DrawIcon(hdc, 0, 0, a)
end sub
Alexanbar писал(а):К сожалению, отрисовка 32битной иконки идёт неверно- например, вокруг значка IE видна чернота
Делаю так:
Dim v() As Byte
Dim i As prjGDIplus.Image
v = LoadResData(107, "32BITICONS")
Set i = CreateImageFromMemory(v)
DrawIconEx Picture1.hdc, 0, 0, i.Icon.Handle, 48, 48, 0, 0, DI_NORMAL
Dim v() As Byte
Dim i As prjGDIplus.Image
v = LoadResData(107, "32BITICONS")
Set i = CreateImageFromMemory(v)
CreateGraphics(Picture1.hDC).DrawImage i, 0, 0, 48, 48
Alexanbar писал(а):Увы, результат аналогичный.
Alexanbar писал(а):Посылаю. Добавил оригиналы иконок IE разных размеров. Ресурсы типа "CUSTOM" и "32BITICONS" добавлял кнопкой "Add Custom Resource"
Dim i As prjGDIplus.Image
Set i = CreateImageFromMemory(Data())
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 111