[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Show an image dynamically in an expanding fashion

Posted on 2010-03-31
5
Medium Priority
?
344 Views
Last Modified: 2013-11-19
I want to show an image on a splash web page as follows:
1) a blank page shows at page load
2) a tiny circle containing a tiny portion of the image shows
3) the circle gradually increases in size showing more and more of the image...
4) the image is finally displayed in its full size.
5) the starting shape is a circle for a round image and may be a square for a rectangular image.
6) the object may be any photo or gif/bmp/jpg/png file?
Please advise how to do the above in very slow motion step by step instructions.
Thanks for your help.
0
Comment
Question by:ksfok
  • 3
  • 2
5 Comments
 
LVL 3

Assisted Solution

by:joeylu
joeylu earned 2000 total points
ID: 29292137
ok, first of all, the most difficult part of your request, is that "circle" you mentioned, the whole solution would be much easier if it's square box instead circle. Why? because based on the browser compatibility issue, making a circle to all browser/versions is like asking all your friends to eat raw fish. So we need to use a image instead, but image has its flaw too, browsers doesn't accept vector images, so you need a image to suite all different resolutions, can't imaging what is going to be if someone use ATI Eyefinity 6, full size the browser in 6 combined monitors to watch this animation, lol, anyway, it's a rare case.

what you need:
1. you need a framework that supports animation, the best for asp.net is jquery without doubt, ajaxtoolkit has animation extender too, but it's not flexible.
2. you need some sort of mask plugin for jquery, when the circle keeps expanding, the background images will appear inside of that circle, that means the circle is a mask, and the center that circle is transparent, which is the part to unmask.
I suggest you to google it for "jquery image mask", I found this one might work for you, but it's always a good idea to swim in the jquery ocean by yourself.
http://pupunzi.com/#mb.components/components.html
3. you need to make a circle with center transparent in PNG format, gif will show ugly edges because you don't have static color for its matte.

general steps:
1. download jquery, attach it into your page
2. download the jquery mask plugin, attach it into your page
3. put the images that you want to show into a div, as a background
4. make another div overlay it, and use it as a mask, put your circle image into that, I suppose the circle needs to be big enough since you want this splash to fill your whole page
5. apply the mask by using the jquery mask plugin
6. apply the animation from the small tiny circle to the big one, by use the jquery animation

that's pretty much it, key word: image mask

btw, adobe flash could achieve this in a better compatibility way, in case you'd like to know
0
 

Author Comment

by:ksfok
ID: 29307341
Could you please teach me the flash approach?
Thanks.
0
 
LVL 3

Accepted Solution

by:
joeylu earned 2000 total points
ID: 29330882
hi, flash is relatively easy in your case

1. open flash
2. create 2 symbol object in the library (a circle, a background image)
3. go edit your movie, put the background image as the first layer
4. add a new layer, fill the whole area in a solid color (the color you want your circle be)
5. add another layer, put that round circle into the middle, then apply the mask
6. add a key frame at begin of that mask
7. add a key frame at the end of this animation end
8. enlarge the round circle at the second key frame
9. create a tween

that's pretty much it, the key word: layer mask in flash, maybe you will have some trouble to adjust the mask at first, read and learn some related tutorial, you should be able to get this
0
 

Author Comment

by:ksfok
ID: 29388549
Please direct me to tutorials on Flash steps mentioned. Thanks,
0
 
LVL 3

Assisted Solution

by:joeylu
joeylu earned 2000 total points
ID: 29428259
type "flash image masking" or "flash layer mask" should get you dozens of tutorials, anyway, here are some I found, not exactly the circle thing, but in the same philosophy

a video tutorial
http://www.metacafe.com/watch/898839/image_mask_animation_flash_video_tutorial/ 

some tutorial
http://www.flash-here.com/tutorials/flash_masking.html
http://www.smartwebby.com/Flash/photo_masking_effects.asp
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this Micro Tutorial viewers will learn how to remove an unwanted object using Photoshop’s feature known as content-aware fill.
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
Suggested Courses

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question