Results 1 to 40 of 716

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

Threaded View

  1. #11
    New Member
    Join Date
    Dec 2011
    Posts
    10

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

    Hi LaVolpe! You are the best programmer I ve ever seen in my life! Thank you and Happy New Year! I have a problem, can you help me, please?
    So, I have a module:
    vb Code:
    1. Public Declare Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (ByVal hInst As Long, ByVal lpIconPath As String, lpiIcon As Long) As Long
    2. Public Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
    3. Public Declare Function DestroyIcon Lib "user32" (ByVal hIcon As Long) As Long
    and Form Code:
    vb Code:
    1. Private Sub Command1_Click()
    2. CommonDialog1.ShowOpen
    3. Dim sPath As String, hIcon As Long, nIcon As Long
    4. sPath = CommonDialog1.FileName
    5. hIcon = ExtractAssociatedIcon(App.hInstance, sPath, nIcon)
    6. DrawIcon Picture1.hdc, 0&, 0&, hIcon
    7. AlphaImgCtl1.PaintImageAsDrawnToHDC (Picture1.hdc)
    8. DestroyIcon hIcon
    9. End Sub
    So, what is wrong in it? Or how can I paint associated icon to AlphaImgCtl1(hdc)? Please, can you help me to correct it? Thanks!
    Last edited by canon1995; Jan 2nd, 2012 at 07:15 AM.

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