Results 1 to 2 of 2

Thread: VBA Combine PNG/JPG to an animated Gif

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2022
    Posts
    1

    VBA Combine PNG/JPG to an animated Gif

    I have been searching on google on how to combine multiple PNG/JPG to an animated GIF using EXCEL VBA but found none. Can someone direct me in the right direction if this is possible or if there is a dll?

    Basically i have already done the function to read png/jpg files from a specific file but require the export function to complete works.

  2. #2
    Member
    Join Date
    May 2021
    Posts
    32

    Re: VBA Combine PNG/JPG to an animated Gif

    When you say you want to combine PNG/JPG files to an animated GIF, do you mean that you want to add each of the PNG/JPG images to an existing animated GIF as separate frames? Or that you what to superimpose/stamp those images onto each of the frames of the GIF? Or ... ?

    I think that perhaps your best bet is to look into the various projects out there in VB6 code, and then convert them into VBA. I say that as someone who also uses (and only has) VBA, and who is learning from more about graphics, APIs, etc, from the all VB6 source code available.

    It can sometimes be relatively straight-forward, but when it comes to anything involving graphics (VB6 has a picturebox control, VBA does not) or making API calls (32 bit or 64bit?), things can start getting tricky quickly. The VB6 Code Bank and the VB6 Forum have a staggering number of projects and the Q&As is a great resource, so I'd suggest running searches specifically in those parts of this site. When I looked just now, I found The Tricks GifMaker project, which looks like it contains most, if not all, of what you need to accomplish the above.

    Also, something I've learnt from these forums that you might find useful is the Windows Image Acquisition COM Object ("WIA"). (link) - you'll see that there are a number of examples demonstrating how to use WIA to do image manipulation, including how to create multiframe TIFF images and how to 'stamp' one image onto another. It also has some support for animated GIFs, though I don't know if that will extend so far as to allow you to add onto an existing GIF file. There is forum member, dilettante, who has written a number of posts about WIA that I've found really helpful in wrapping my head around the scope and extent of WIA's possibilities. He also has a few projects (or least one that I know of) where dilettante has helpfully (mercifully?) provided the project code in VBA. :-)

    Hope that is helpful. I will let you know if I come across anything that might relevant.

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