Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simultaneous image transitions 1

Status
Not open for further replies.

g33man

Programmer
Dec 22, 2006
50
CA
I am trying to accomplish multiple image transitions simultaneously. A good example of my goal is the Google Picasa Screen saver. It does a zoom, pan, and fade transition all at the same time! I have found VB6 examples of performing each transition on their own, but no direction on combining these effects.
Suggestions are very welcome.
Mike
 
Sort of. I am working on a specialized slide show app, and have not found a free/commercial solution that meets all my needs.
The Google Photo screen saver has the best image transition I have ever seen. It shows one photo, and slowly zooms it (in or out) while panning it, ever so slowly - It is very effective! When the times comes to switch to the next image, it maintains the zoom+pan animation, then fades it out, while fading in the next image, to an already moving different zoom+pan geometry.

A year ago, I tried a commercial OCX called XSHOW, but it could only do one of the animations at a time. I've found several references to routines such as AlphaBlend, but I have not figured out how to make all these things happen simultaneously.

I am not ready to give up on finding out how this is done, now that I've seen another program do it!
-mike
 
Are you sure the Google screen saver doesn't use DirectX or some other graphics-accelerated method to achieve this? (I only mention it in case you're asking too much of VB's speed).

You can certainly use AlphaBlend to do the fade between the old and new images, and obviously the pan is pretty easy using BitBlt. The zoom might be harder as StretchBlt doesn't anti-alias and so it wouldn't be smooth enough.

However, I can't quite see the extent of your problem. You need two hidden picture boxes to hold the current picture and the next picture, and probably a third to display the result unless you want to paint directly onto the form background. Then it's simply a case of preparing each image with whatever transitions you're doing (pan / zoom) and combining them using AlphaBlend to produce a hybrid. Whether VB can do it fast enough and without the screen flickering is another thing entirely.

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Well my whole point is, or was, is that, if you have something zooming in, it either has to be done in a loop or something that can be put in a loop as it is a bunch of instructions repeated or can be called from a loop. Same goes for tilting, paning, fading, blending, sliding, inverting, and can we think of any thing else???? I'm betting you could come up with something even better with a master control loop that calls any or all of these transition effects, or even a select few as each effect has a starting point and an ending point or end result effect that they all work towards...



Good Luck

 
Sorry vb5, I didn't interpret correctly when you asked "if the transitions were in a loop". Of course they are (except when I was using the XSHOW control, which had its own internal loop I assume).

Andy, I have no idea how Google is doing this effect. I spent a ton of time searching for the author of this screen saver, but they conceal this well.

Finding this solution will be a labour of love.
-mike
 
I guess you are talking about something like the Ken Burns effect illustrated on this page:
Note that this is all done in JavaScript ... so no reason why we can't do something similar in VB6

Mind you, I'd be tempted to look at GDI+ for this sort of stuff in VB. You'll need to download Dana Seaman's 's GDI+ Type Library (or similar) to gain proper access to the GDI+ functionality, since the core library was not originally designed to be used from VB.
 
YES! The Ken Burns effect is *exactly* what I am trying to accomplish. The link provided shows an example that is a bit fast, but obviously that is variable. Interesting idea about the GDI+ as many of the links I found discussed this, but I have not gone there - yet!
Thanks strongm.

-mike
 
> Interesting idea about the GDI+ as many of the links I found discussed this, but I have not gone there

If you search this forum you should find a multitude of posts from me about GDI+ and how to use it from VB
 
It seems to me you could achieve the Ken Burns effect in VB provided you can find a way to zoom in or out of an image and antialias the result, perhaps the GDI+ library can help with that as it will certainly be the most processor-intensive aspect of the loop especially if the images are full-screen size. The scroll and cross-fade can certainly be done in VB. (Alternatively, use a WebBrowser control instead of a PictureBox and do it in Javascript ha ha).

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top