Page 17 of 18 FirstFirst ... 71415161718 LastLast
Results 641 to 680 of 710

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

  1. #641

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

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

    Quote Originally Posted by Black_Storm View Post
    1-#636 not answered yet ( its about vb6) ( i can not call loadgdipplus or other functions when i used aic user control in my user control)
    Can you show me how you are using the control in your project? Specifically, the project tree view. Group project? Is the AIC compiled to an ocx? More details needed.

    Quote Originally Posted by Black_Storm View Post
    2-i created a user control in vb6 and properties seted to transparent backstyle and tested in vb.net and worked good so my problem is not about user control my question is about aic user control because when i want use aic user control in vb.net backcolor is opaque so problem is about aic.
    Already mentioned, I can't answer your .Net questions. The control was designed for VB6 not .Net and .Net can have issues with VB6 developed controls.

    Quote Originally Posted by Black_Storm View Post
    3-i hv a question about how use UserDocument class , i want get percent ( 0 to 100 progress) of download and show percent in form too,i readed about UserDocument class and events in it like AsyncReadProgress(AsyncProp As AsyncProperty) and AsyncProp.BytesMax,AsyncProp.BytesRead.can u send a sample code for download more than 1 pictures as async and with percent downloading(0 to 100)?
    This should be posted in the VB forums as it appears to have nothing to do with this control.


    Quote Originally Posted by Arnoutdv View Post
    And if you are not satisfied with the control you should ask for a refund.
    And being the Xmas holiday week - refunds are extended for another year
    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}

  2. #642
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    578

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

    Hopefully just a quickie. I realised this morning that the sizes for my Coverart were always returned correctly by Alpha, but the colour depth isn't.

    I am attaching a Cover which I believe is 24BPP but alpha reports 32. Mp3Tag and Irfanview show the same sizes but only 24BPP.
    Attached Images Attached Images  

  3. #643

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

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

    How is the cover art being extracted? Your attachment is JPG (forums probably converted it).

    Is the cover art being resized before being added to the AIC? Reason I ask is that resizing can introduce 32bpp alphadepending on the interpolation method. GDI+ can blur the edges when higher interpolation modes are used. This alphablending may not be noticeable by the human eye (typically 1 pixel edges), but exists nonetheless. In addition, using the clipboard to set an image can report the image as 32bpp because the DIB placed on the clipboard may be 32bpp when the O/S screen depth is 32bpp.
    Edited: Clipboard scenario was incorrect/misleading. The 32bpp scenario applies to screen captures and DIB placed on clipboard.

    Otherwise, probably going to need the source file zipped up so I can take a look see, if it's important enough. If the source is MP3 or WMA, the parsing routines will attempt to use the cover art, as-is, if only 1 image exists. If multiple images exist, a conversion from the original format to TIFF is performed, per image, and all images in the source become a multi-page TIFF. But IIRC, there is no conversion to other bit depths during the process of adding the image to a TIFF page (exception may be color-lossless depth reduction to 24/8/4/1 from higher depth, if possible)

    Edited: Why multi-page tiff? The AIC has no way of returning multiple images in any format other than ICO/CUR/GIF/APNG/TIFF. GIF is restricted by depth (8bpp or less), APNG not a widely accepted format, and ICO/CUR not really appropriate in this case. Since the parsing routines weren't designed to return an array of images, TIFF seemed an acceptable solution since each tiff page can be a different color depth and size from any other page. In addition, the AIC has methods to navigate/select individual pages
    Last edited by LaVolpe; Dec 30th, 2017 at 10:56 AM.
    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}

  4. #644
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    578

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

    Thanks for looking at this Keith. I don't use the AIC for extraction as my programme can load and play any format.

    The AIC is on Form2 'the Edit form' and I have set the AIC to scale the images to its size. I use the TagsLibrary dll from 3delite over at Un4seen.com. It sends the data out as a stream so I do the following;

    Code:
    If CoverArt.Data <> 0 Then 'See is there is any data in memory
                Form2.A1.Picture = LoadPictureGDIplus(PFM.MemToHBitmap(ByVal CoverArt.Data, ByVal CoverArt.DataSize.LowPart - 1)) 'Get an hBitmap handle from the memory and pass it to AIC. jpg's only.
            End If
    I can use the same handle (converted to stdpicture) to load an image control. Both the Image and the AIC report the same sizes. But the image handle sent to GetObject returns 24bit AIC returns 32. Also mp3Tag, dbPoweramp and Irfanview report 24.
    Attached Files Attached Files

  5. #645

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

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

    First. That image is JPG. When loaded into VB image/picturebox, the JPG is converted to bitmap. Therefore, what is being passed from the .Picture.Handle property is a 24bpp bitmap handle. If you were to load that JPG file into the AIC or pass the VB image/picturebox .Picture.Handle value, you should get 24bpp also.

    This JPG you posted must have been converted from bitmap at some point?

    Your MemToHBitmap() returns a bitmap handle not a JPG. When a handle is passed to AIC, it is processed by modCommon.pvProcessGDIhandleSource. That routine uses API GetObject to return info about the handle. Included in that info is the bit depth. If the depth is being reported as 32bpp, then that explains it. Now, if bit depth returned in that info < 32, then the routine calls GdipCreateBitmapFromHBITMAP API to create a GDI+ image from that handle. I doubt that API creates a 32bpp image from the handle if the handle was to a 24bpp image.

    As a more definitive test, suggest this and let me know what it returns.
    Code:
    hBmp = PFM.MemToHBitmap(ByVal CoverArt.Data, ByVal CoverArt.DataSize.LowPart - 1)
    GetObject hBmp, Len(udtBmp), udtBmp: Debug.Print udtBmp.bmBitsPixel
    DeleteObject hBmp
    Edited: If GetObject info indicates 32bpp, here is what I'm thinking... MemToHBitmap creates a DIB based on the O/S screen depth, then converts the cover art image to bitmap and passes that DIB handle. Since your screen depth is likely 32bpp, a 32bpp handle.
    Last edited by LaVolpe; Dec 30th, 2017 at 10:05 AM.
    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}

  6. #646
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    578

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

    Ok the returned value is 32. Here is the code for the converter, it is part of a Class from Emil Weiss. It doesn't look like it uses the clipboard but I am sure you will pinpoint the problem.

    Just so I understand, if I load the same jpg into an image control using LoadPicture it still says 24. is that for the reasons stated above? I can post the entire class if you want.

    Code:
    Public Function MemToHBitmap(ByVal DataPtr As Long, ByVal Size As Long) As Long
        Dim bArray() As Byte
        Dim stream As IUnknown
        Dim Img As Long
        Dim hBitmap As Long
    
        ' Array Redimensionieren
    
        ReDim bArray(Size - 1)
        CopyMemory bArray(0), ByVal DataPtr, ByVal Size
    
        ' Stream erstellen
        CreateStreamOnHGlobal bArray(0), False, stream
    
        ' ist ein Stream vorhanden
        If Not (stream Is Nothing) Then
    
            ' GDI+ Bitmapobjekt vom Stream erstellen
            If Execute(GdipLoadImageFromStream(stream, Img)) = OK Then
    
                ' Handle des Bitmapobjektes ermitteln
                If Execute(GdipCreateHBITMAPFromBitmap(Img, hBitmap, 0)) = OK Then
    
                    ' hBitmap zurück geben
                    MemToHBitmap = hBitmap
                End If
    
                ' Bitmapobjekt löschen
                Execute GdipDisposeImage(Img)
    
            End If
        End If
    
    End Function

  7. #647

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

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

    Took a little bit to troubleshoot. The answer: GdipCreateHBITMAPFromBitmap creates a 32bpp bitmap from at least 24bpp images. Not tested whether this also applies to 16 bits or less.

    Bottom line: AIC is reporting correctly. The bitmap depth associated with the handle from your routine is 32bpp. If you were to pass the MP3/WMA file name to the AIC, you'd likely return the 24bpp bitmap/jpg you are expecting.

    Note to self: Should I ever rebuild this project, that's another thing I'll have to keep in mind. I also use that API in some cases and wasn't aware it appears to use the screen color depth when creating a bitmap. Never fully tested that API to understand various what-if scenarios.

    Oops, didn't answer your other question
    Just so I understand, if I load the same jpg into an image control using LoadPicture it still says 24. is that for the reasons stated above?
    Kinda apples and oranges. JPG and BMP are different animals. That function you posted does not produce JPGs, it produces a bitmap. Your JPG is coming from some other routine. Regarding JPGs, VB converts JPG internally to BMP in order to display it in the image/picturebox controls. All JPGs should report 24bpp or less; therefore, VB's .Picture.Handle will be a 24bpp (or less) bitmap. The problem, if you want to call it that, is your routine's GdipCreateHBITMAPFromBitmap defaulting to screen depth in this case.

    In fact, if you use a function like "HandleToStdPicture" and pass the hBmp returned from your function to create a stdPicture object for VB's use, then GetObject will return 32bpp when passed .Picture.Handle. BTW: HandleToPicture or HandleToStdPicture can be found on this site for converting a hBmp handle to a VB stdPicture object. It is also available in the AIC: modCommon.HandleToStdPicture
    Code:
    ' copy HandleToStdPicture and related APIs to your form, then...
    hBmp = PFM.MemToHBitmap(ByVal CoverArt.Data, ByVal CoverArt.DataSize.LowPart - 1)
    Set Me.Picture = HandleToStdPicture(hBmp, vbPicTypeBitmap)
    GetObject Me.Picture.Handle, Len(udtBmp), udtBmp: Debug.Print udtBmp.bmBitsPixel
    Last edited by LaVolpe; Dec 30th, 2017 at 11:28 AM.
    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}

  8. #648
    Fanatic Member
    Join Date
    Jul 2007
    Location
    Essex, UK.
    Posts
    578

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

    Thank you very much. There was me thinking it might be a 'quickie'!

    Happy New Year to you & yours.

  9. #649
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

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

    Quote Originally Posted by LaVolpe View Post
    Can you show me how you are using the control in your project? Specifically, the project tree view. Group project? Is the AIC compiled to an ocx? More details needed.

    Already mentioned, I can't answer your .Net questions. The control was designed for VB6 not .Net and .Net can have issues with VB6 developed controls.

    This should be posted in the VB forums as it appears to have nothing to do with this control.


    And being the Xmas holiday week - refunds are extended for another year


    1-i maked a copy of aic orginal source and then opened.then added another user control under aic user control and then used aic control in my user control.then i create a new property for example loadpic name by vb6 activex interface wizard and then when i called loadgdiplus or other functions so vb know that function but dont know parameter so show error to me about unknow function called.

    about question 3 : my means about use aic control because i seen UserDocument class in aic control and events definiition of it and i seen AsyncReadProgress(AsyncProp As AsyncProperty) and AsyncProp.BytesMax,AsyncProp.BytesRead. too in aic control. i want use aic control and get percent of download image between 0 to 100 %and show on form too.i think if i can use AsyncProp.BytesMax and AsyncProp.BytesRead used in UserDocument class of aic control so i can make percent but my problem about how use of this class?can you send a simple sample to how use aic control and use UserDocument class to can get percent of download?

  10. #650

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

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

    Ah, now I understand the problem for #1. Those functions are part of a class. The class is "Global" for projects that include the AIC, not for the AIC itself. If you'll look at code in the AIC, you will notice no code calls those functions, rather they call the functions in the bas module. Since the bas module cannot be made public to projects that include the AIC but a class can, the class wraps some of the bas module functions. If you want the intellisense, you'll need to create an instance of the class and then call the functions in that class, then release the class.

    Regarding #3. There are many examples on this site and one exists in this codebank for using a usercontrol to download from the internet with a percent-like status. Here is one: http://www.vbforums.com/showthread.p...tra-dependency
    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}

  11. #651
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

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

    i want use aic for download images but i want can see percent download too and show on form percent.how can do that?how can use of "UserDocument class" dinnifition in aic in my project too? can i use of their events ? can u send a simple sample ?

  12. #652

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

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

    You can use another usercontrol (or other methods) to download whatever you want. With those other methods, create your percentage display as needed, and when the complete file has been downloaded, then send the data to the AIC to display the image. You are asking questions that are not relative to this control and I am not not going to help you modify/rewrite my control for your purposes. If you have questions about UserDocuments, post those in the questions portion of the forum. Good luck.
    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}

  13. #653
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

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

    any body here can help me about show png image on form or desktop with blur effect under it ?
    my thread : how can show my png image on form with display blur effect under it-need user control

  14. #654
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

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

    Quote Originally Posted by Black_Storm View Post
    any body here can help me about show png image on form or desktop with blur effect under it ?
    my thread : how can show my png image on form with display blur effect under it-need user control
    can i use aic control for display image with blur effect under it ? if possible so how?
    i want test on form and use for dekstop (layred windows ) too

  15. #655
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,857

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

    @Black_Storm, please start your own threads for questions
    You are polluting this CodeBank submission with questions about your own project.

  16. #656
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

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

    hi i hv new question when i want use aic control,
    1-i want just a png image and when resize to horizontal or vertical then repeat image like repeater(i want use png or apng image and use resize action too.(like attached picture)
    how can do that?
    i want like number 2 after resize
    Name:  0.jpg
Views: 1693
Size:  29.9 KB

    2-i am using aic control, now i want make mask clipping how can do that like this picture?
    or any other idea?


    3- i am doing use aic control but now i want put my pnd or apng image on other controls like text box frame or .... ? (see this picture)
    if not possible so any idea?

    Name:  1.png
Views: 1605
Size:  64.3 KB
    Last edited by Black_Storm; Jan 21st, 2018 at 03:36 AM.

  17. #657

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

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

    1. Repeating, tiling. In the previous page (post 631), I gave an example of creating a blank GDIpImage and drawing into it. You can use something like that to create an image on the fly. You could also look at the TilePictureGDIplus global function, but that draws to a DC, does not create a new image.

    2. Mask clipping. Never looked into it. Your animation looks neat. I'd imagine this would not be something really simple. One may need to define pixels in 3D space and apply 3D rendering algorithms? That's just a guess and good luck -- should be challenging.

    3. You have asked this question several times in the other part of the forums. I'm not going to use this thread to discuss topics not related to this control. I've said that before and from this point forward, will simply ignore such questions in the future. Sounds like you are using my control inside another one you created and/or extracting my controls code for your own purposes. That's not a problem, but I'm not going to spend time making that work for you, or anyone else. No insult intended.
    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}

  18. #658
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

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

    Quote Originally Posted by LaVolpe View Post
    1. Repeating, tiling. In the previous page (post 631), I gave an example of creating a blank GDIpImage and drawing into it. You can use something like that to create an image on the fly. You could also look at the TilePictureGDIplus global function, but that draws to a DC, does not create a new image.

    2. Mask clipping. Never looked into it. Your animation looks neat. I'd imagine this would not be something really simple. One may need to define pixels in 3D space and apply 3D rendering algorithms? That's just a guess and good luck -- should be challenging.

    3. You have asked this question several times in the other part of the forums. I'm not going to use this thread to discuss topics not related to this control. I've said that before and from this point forward, will simply ignore such questions in the future. Sounds like you are using my control inside another one you created and/or extracting my controls code for your own purposes. That's not a problem, but I'm not going to spend time making that work for you, or anyone else. No insult intended.
    i writed tag in question about png or apng,how work with animated png too ? i seen post 636 but was been about single image static. can u send a sample code to can repeat apng too(my means i want duplicate one animation to example 10 count in result was been in a single image box)

    2- i dont work with 3d space but i want just can use mask clipping for can show something under my image or front on my image by hidding some curves,no way ? or simple mask cliping sample code ?

    3-because i am waiting for find solution for this problem yet.

  19. #659
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

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

    Quote Originally Posted by Black_Storm View Post
    i writed tag in question about png or apng,how work with animated png too ? i seen post 636 but was been about single image static. can u send a sample code to can repeat apng too(my means i want duplicate one animation to example 10 count in result was been in a single image box)

    2- i dont work with 3d space but i want just can use mask clipping for can show something under my image or front on my image by hidding some curves,no way ? or simple mask cliping sample code ?

    3-because i am waiting for find solution for this problem yet.
    can u send a sample code for repeat apng too ?

  20. #660
    Addicted Member
    Join Date
    Jun 2009
    Location
    C:\Windows\SysWOW64\
    Posts
    227

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

    Can some moderator/admin please move those posts to a new thread?
    This thread is not for supporting the usage of the control.

  21. #661
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

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

    Quote Originally Posted by Cube8 View Post
    Can some moderator/admin please move those posts to a new thread?
    This thread is not for supporting the usage of the control.
    my apng image is like this (left image) :



    i want when i resize my aic control horizontal so can see right image result.how can do that ?
    Last edited by Black_Storm; Jan 24th, 2018 at 09:17 AM.

  22. #662
    Addicted Member
    Join Date
    Jun 2009
    Location
    C:\Windows\SysWOW64\
    Posts
    227

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

    Quote Originally Posted by Black_Storm View Post
    when i am useing aic so why i shoulld be create new thread and when i am use apng supported format in aic control so why i shoulld be create new thread about work with aic control? maybe possible with aic control and other code
    The purpose of this thread is to provide code for download and maybe some clarification about its usage.
    For more help/support, you should create a thread under Visual Basic 6 and Earlier forum, in order to avoid clutter in this one.

  23. #663

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

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

    @Black_Storm. Remember that this tool is primarily for displaying images, not an image editor/composer. It isn't a mini-paint program. In addition, I already warned you that once you decided to modify my code for your purposes, my support would be limited, if at all.

    Above being said, you have to understand APNG to even attempt to build it frame by frame, which would be needed in this case. It might be doable by filling in a MULTIIMAGESAVESTRUCT and passing that to SavePictureGDIplus. No guarantees.
    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}

  24. #664
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

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

    hi, i want create a simple app like paint but i want use aic control and then i want these parameters :

    1-can open a image size more than 7000 px in 7000px.
    2-can zoom in or zoom out in it. (mouse wheel support)
    3-can move in zoomed image like hand cursor
    4-can draw rectange or star or another png image on my master image
    5-can draw text on my master image with custom size or font or color
    6-can undo or redo
    7-and finally can save image edtied in another place.

    can u have a simple source code aic used to can use in my project
    and my question is about each numbers.

    for example :
    about 1: can use these sizes(more than 7000 px width or height in aic?) (can u send a sample code or source code to can use?)
    about 2: how can zoom in or zoom out with aic?(can u send a sample code or source code to can use?)
    about 3: how can move like hand cursor in aic zoomed?(can u send a sample code or source code to can use?)
    about 4 : how can draw another aic image on my master aic image control?(can u send a sample code or source code to can use?)
    about 5: how can draw text with customize color or font on my aic control?(can u send a sample code or source code to can use?)
    about 7-how can merge all layers or images mereged in aic control?(can u send a sample code or source code to can use?)

  25. #665
    Fanatic Member Black_Storm's Avatar
    Join Date
    Sep 2007
    Location
    any where
    Posts
    575

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

    hi, i tested this code on windows 7 and work good :
    for run i should be use 2 aic control names ( aicFace and aicHour ) on form.
    i used this code for blend 2 images and then save as png .

    Code:
    Dim tmpc As Integer
     tmpc = 0
     tmpc = Val(ucPic.Tag)
     tmpc = tmpc - 1
    
     Dim imgClockFace As GDIpImage
     '
     Set aicFace.Picture = LoadPictureGDIplus(App.Path & "\actions\temp" & tmpc & ".jpg", True)
     aicFace.Left = 0
     aicFace.Top = 0
     aicFace.Width = aicFace.Picture.Width
     aicFace.Height = aicFace.Picture.Height
     '
     '
     Dim idx As Byte
     idx = 0
     If op(0).Value = True Then idx = 0
     If op(1).Value = True Then idx = 1
     If op(2).Value = True Then idx = 2
     If op(3).Value = True Then idx = 3
     '
     Set aicHour.Picture = LoadPictureGDIplus(App.Path & "\tmpalamat\idx" & idx & ".png", True)
     aicHour.Left = 0
     aicHour.Top = 0
     aicHour.Width = aicHour.Picture.Width
     aicHour.Height = aicHour.Picture.Height
     Dim pms As PICTUREMERGESTRUCT
     If imgClockFace Is Nothing Then Set imgClockFace = aicFace.Picture
    
     With pms
     .CanvasHeight = aicFace.Height
     .CanvasWidth = aicFace.Width
     .Pictures = 2
     ReDim .MIS(0 To 1)
     Set .MIS(0).Picture = imgClockFace
     .MIS(0).Width = pms.CanvasWidth
     .MIS(0).Height = pms.CanvasHeight
     Set .MIS(1).Picture = aicHour.Picture
     .MIS(1).Left = X - (a(idx).Picture.Width \ 2)
     .MIS(1).Top = Y - (a(idx).Picture.Height \ 2)
     .MIS(1).Width = aicHour.Width
     .MIS(1).Height = aicHour.Height
    
     End With
     
     
    
     Set aicFace.Picture = MergePictureGDIplus(pms)
     SavePictureGDIplus aicFace.Picture, (App.Path & "\actions\temp" & Val(ucPic.Tag) & ".png"), lvicSaveAsPNG
    but same code not worked in windows 10 because of this part :

    Code:
     With pms
     .CanvasHeight = aicFace.Height
     .CanvasWidth = aicFace.Width
     .Pictures = 2
     ReDim .MIS(0 To 1)
     Set .MIS(0).Picture = imgClockFace
     .MIS(0).Width = pms.CanvasWidth
     .MIS(0).Height = pms.CanvasHeight
     Set .MIS(1).Picture = aicHour.Picture
     .MIS(1).Left = X - (a(idx).Picture.Width \ 2)
     .MIS(1).Top = Y - (a(idx).Picture.Height \ 2)
     .MIS(1).Width = aicHour.Width
     .MIS(1).Height = aicHour.Height
    
     End With
    when i changed lines to comment so program runed but without my result.
    i want know why this source code work on win7 but not work on win10? and how can fix this code to can use in windows 10 too?

  26. #666

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

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

    Can you be more specific as to what did not work? In the code you posted, are any of the values 0 or image references set to Nothing? You really didn't give me enough information to go on. Could be helpful to post the saved image from Win7 and the saved image in Win10.

    Also, ensure your app has write permissions to: (App.Path & "\actions\temp" & Val(ucPic.Tag) & ".png")
    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}

  27. #667
    Addicted Member
    Join Date
    May 2011
    Posts
    230

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

    Hi Lavolpe,

    recently I started to have random crash with AIC as if Microsoft made a patch where the garbage collector make something where the parent container initialize after the init event... anyway,

    m_HitTestPts is empty sometime when sptGetHitTest() is called and that result in subscript out of range on line:

    If m_HitTestPts(pNew).X > m_HitTestPts(pOld).X Then

    any idea how I could fix this ?

    it happen only in IDE, but I have to reboot the IDE like hundred of time a day... very annoying. when it happen, any compiled OCX made with AIC crash with the error "there is no licence for this component"

    plz help!

  28. #668

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

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

    Can you reproduce the error on demand?

    In the sptGetHitTest() routine, m_HitTestPts array should already be filled and is tested when the HitTest property is either lvicEntirelImage or lvicTrimmedImage, control is enabled (default), has a picture assigned, and mouse events are wanted (default). The sptGetHitTest() routine is called when mouse is over the control or releasing the mouse button during a click/drag event.

    Each time the hit test should be recalculated, the m_RenderFlags is updated to include the bit: render_DoHitTest. This is triggered in a couple of events: Paint, changing the HitTest property, and WantMouseEvents property.

    You can try adding this:
    Code:
            If (m_RenderFlags And render_DoHitTest) Then
                If m_HitRegion = 0& Then Call sptCreateHitTestPoints(m_HitRegion)
            End If
    to the sptGetHitTest() routine, immediately after the statement: If UserControl.Enabled Then

    Theoretically, that could be a valid sanity check that may solve the problem. Just can't think of any combination you are using that could be causing the problem. Only thing that comes to mind is DoEvents possibly, maybe the UserControl_Hide() event not triggering (that releases the timer used to check for mouse over/leave events)
    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}

  29. #669
    Addicted Member
    Join Date
    May 2011
    Posts
    230

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

    Quote Originally Posted by LaVolpe View Post
    Can you reproduce the error on demand?

    In the sptGetHitTest() routine, m_HitTestPts array should already be filled and is tested when the HitTest property is either lvicEntirelImage or lvicTrimmedImage, control is enabled (default), has a picture assigned, and mouse events are wanted (default). The sptGetHitTest() routine is called when mouse is over the control or releasing the mouse button during a click/drag event.

    Each time the hit test should be recalculated, the m_RenderFlags is updated to include the bit: render_DoHitTest. This is triggered in a couple of events: Paint, changing the HitTest property, and WantMouseEvents property.

    You can try adding this:
    Code:
            If (m_RenderFlags And render_DoHitTest) Then
                If m_HitRegion = 0& Then Call sptCreateHitTestPoints(m_HitRegion)
            End If
    to the sptGetHitTest() routine, immediately after the statement: If UserControl.Enabled Then

    Theoretically, that could be a valid sanity check that may solve the problem. Just can't think of any combination you are using that could be causing the problem. Only thing that comes to mind is DoEvents possibly, maybe the UserControl_Hide() event not triggering (that releases the timer used to check for mouse over/leave events)
    Hi Lavolpe, thanks for your answer.
    I'm not using DoEvents (EVER) I consider it a "last" resort that has the potential to crash a program... for many reason you just mentionned.

    I can reproduce the bug. it appeared on my dev machine recently (4 month ago) after a Microsoft Patch wich I can't retrace now. Oh... btw, stay FAR away from feb 13 2018 kb 4011686 (126mb) it's a Office 2016 Patch. if you install it, Vb IDE crash when you "open" an Access Database using ADO. Compiled EXE are sane though.

    anyway, like I said about AIC, if I make "any" project with it, even an empty one and start the program (F5) in IDE, sometime it work, sometime it crash... normally, less then 5 attempt, make it crash. the time you spend between retry has no incidence, it's not a timing issue.

    I'm about to reformat my machine soon to see if that fix the problem. only Vb6 IDE is affected. (safe for Office 2016 patch) ... strange... seem almost intentional

  30. #670
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

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

    Use a virtualbox with a fresh os.

  31. #671
    New Member
    Join Date
    Sep 2018
    Posts
    5

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

    just wanted to say thanks the control is awesome and helped me to understand alot

  32. #672
    New Member
    Join Date
    Nov 2016
    Posts
    3

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

    Hello, first of all I must say that the control is fantastic. I am very ignorant about programming and I am "very basic user". So I hope you will forgive me for my question: is it possible to copy the image loaded in a standard picturebox and modified with drawing commands (line, circle, ...) in an AIC ? If yes, which is the syntax I would use ? (I tried: Set AIC.picture = Picturebox1.picture but, of course, it does not work). I would like to avoid the need to save to disk the content of Picurebox1 and load again into AIC. Many thanks in advance for your reply

  33. #673
    Fanatic Member
    Join Date
    Aug 2016
    Posts
    597

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

    It's a very valuable material to study GDI+ and do photographic programming.
    Have anyone converted to .NET?

  34. #674
    New Member
    Join Date
    Dec 2011
    Posts
    4

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

    Awesome control. We use it throughout our programs. Any update on the release of v3 of this control?

  35. #675

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

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

    Quote Originally Posted by jeakins01 View Post
    Awesome control. We use it throughout our programs. Any update on the release of v3 of this control?
    I'm not sure - lost a bit of interest. I have torn this thing down at least a dozen times and was never happy with the end result. With the ability to use thunks along with GDI+ to render directly into VB image controls. I'm not even sure something like this control is even worth the effort of maintaining, other than it's a convenience for those not fluent with GDI+.

    I wouldn't hold my breath for an update since I have gone in different directions... but never say never.
    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}

  36. #676
    New Member
    Join Date
    Dec 2011
    Posts
    4

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

    Are there any examples of copying a part of the current form screen to this AIC control. I have tried several methods and they are not working. Using BitBlt to copy to a picture object and using LoadPictureGDIPlus to load it into the control. I get invalid picture object. The goal is that I then want to use the control to rotate the captured screen image section.

  37. #677

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

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

    If you open the class: AICGlobals, and look at the samples in the method: LoadPictureGDIplus, you will see a really simple potential solution. You'll also want to set the Rotation, Aspect and other applicable properties of the control.
    Code:
    AlphaImgCtl1.Picture = LoadPictureGDIplus(Screen)
    If you are interested in the code behind that call, then open the module and look at the bottom of the method pvProcessObjectSource for the line: ElseIf TypeOf Source Is Screen Then

    Note: The above will do the entire screen. Since you only need part of the screen, reviewing the code behind the call would be useful.
    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}

  38. #678
    Hyperactive Member
    Join Date
    Jul 2017
    Posts
    338

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

    I love this control very much! I use it to drag pictures from Chrome to VB6.
    It works great.

    However, there is a situation where VB6 can hang.

    Do you think you could have a look, please?

    Could you please start Chrome and then search for an image?

    In my case, I have searched for "schleudern".
    Then I have dragged the image of the girl onto the LaVolpeAphaImg.

    The first time you do this, nothing will happen. The image won't show up in the control, but it won't hang.
    Now when you try it again, VB6 will hang.
    I have taken a quick look what happens in the control, but I soon got into the complex parts of the code.

    Do you think you could take a look?

    Thank you so much!!

    ps: I have a recorded a to show what I'm doing.

    Last edited by tmighty2; Sep 9th, 2019 at 07:44 PM.

  39. #679
    Hyperactive Member
    Join Date
    Jul 2017
    Posts
    338

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

    I just noticed that the control has got its final update.
    Also, it works perfectly fine with Firefox, so I guess it's a problem with how Chrome handles this image dragging... it shows this "collection bar" where the user can drop the image.
    So I do have a solution for this problem.

  40. #680
    Hyperactive Member
    Join Date
    Jul 2017
    Posts
    338

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

    Unfortunately the same problem occurs with Firefox. So it's browser independent, but it seems to happen if the google collection bar appears.

Page 17 of 18 FirstFirst ... 71415161718 LastLast

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