Just download both files. Will get back to you after I've had a chance to review them
Edited; That was easy. Simply call aImg.Refresh after you are done setting properties and before you read the properties:
I'll look at the other project today or tomorrow... Done.Code:.... aImg.AutoSize = lvicSingleAngle aImg.Refresh ' view the changes <<<< moved this here If (aImg.Width = 400) Then Stop 'Not supposed to happen... End If
What is the issue? Are you wondering why there are like several images in a single image? If so, that is not uncommon. What you are looking at is a bitmap that contains several mini-images. The app loads that resource then BitBlt's the image from it that it wants to be used for whatever purposes; probably a toolbar. The shell32.dll does something very similar too. As I said, this is not uncommon. If you tweak your code a bit, you'll see what I'm talking about. The difference with the shell32.dll is that it stored a 32bpp alpha bitmap whereas your depends.exe did not.
P.S. Please do remove that sample project since it contains an executable & forum policy prohibits that.Code:Private Sub Form_Load() Me.ScaleMode = 3 'Pixel 'LoadIconX App.Path & "\depends.exe" LoadIconX "C:\windows\system32\shell32.dll" End Sub Public Sub LoadIconX(ByVal pstrFileName As String) Dim objGDIpImage As GDIpImage ' Set objGDIpImage = New GDIpImage Set objGDIpImage = LoadPictureGDIplus(pstrFileName, True) objGDIpImage.ImageIndex = 20 ' this is the specific one I was talking about AlphaImgCtl1.Width = objGDIpImage.Width AlphaImgCtl1.Height = objGDIpImage.Height Set AlphaImgCtl1.Picture = objGDIpImage End Sub




Reply With Quote
