Forum Moderators: not2easy

Message Too Old, No Replies

Using clip to display a smaller part of an image?

         

Kolyana

4:35 am on Nov 27, 2003 (gmt 0)

10+ Year Member



I'd like to take an image, any image, and display a 50x50 section of it's near center.

I tried clip:rect(0 50 50 0) to no avail. i tried putting the clip on the image, on a surrounding div and both, but no success.

I'm assuming that this is possible, but I'm mising some finer points.

Is this method also more widely supported across the browsers and versions than a div with no overflow?

Is there a better way to doing this, or is it even possible?

Happy Thanksgiving one and all.

SuzyUK

9:05 am on Nov 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Kolyana, clip isn't widely supported yet... but would putting image as a background image be a solution?

Doing that you can display whatever "bit" you need to using the background-position properties.. just make the <div>(or whatever element) the dimensions you need..

Suzy

Kolyana

1:55 am on Nov 28, 2003 (gmt 0)

10+ Year Member



Thanks Suzy. Nice idea. I did it in another area for the reasons you have described, but wondered about the general viability of clip.

I see now that there isn't any :)

dfparker

6:56 am on Nov 28, 2003 (gmt 0)



Happy to report that what Kolyana asks *is* possible:

Please check out an amazing library that makes it possible, [dynapi.sourceforge.net...] (RTFM)

and here is the money shot, [cendtonio.free.fr...]

-David