Results 1 to 40 of 716

Thread: [vb6]Alpha Image Control v2 - Final Update (15 Jan 2012)

Threaded View

  1. #10

    Thread Starter
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: [vb6]Alpha Image Control (PNG, AniGIFs, TIFF, & more) [26 Nov 2011]

    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:
    Code:
    ....
      aImg.AutoSize = lvicSingleAngle
      aImg.Refresh    ' view the changes <<<< moved this here
      If (aImg.Width = 400) Then
        Stop  'Not supposed to happen...
      End If
    I'll look at the other project today or tomorrow... Done.

    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.
    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
    P.S. Please do remove that sample project since it contains an executable & forum policy prohibits that.
    Last edited by LaVolpe; Jan 3rd, 2012 at 07:13 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width