CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2002
    Location
    Washington, USA
    Posts
    104

    Question Clipping an image

    Using Javascript and CSS, I am trying to create an animation where a picture (jpg) is displayed by an expanding rectangle from it's center point.

    I haven't gotten to the animating part because I can't get the clip and overflow properties to work at all in IE 6 (I'm focusing on one browser for now - I'll work on compability after I've gotten the basics nailed down). By "not working", I mean there is no noticable change to the image when I try to set the clip rectangle in via javascript. (Nor was there any when it set it statically in a stylesheet, for that matter.)

    Are overflow/clip supported by IE6? Am I missing some key bit of knowledge about clipping and bounding boxes?

    The code is a bit messy right now (as it's under development), but you can look at it here:

    http://www.codemastershawn.com/class...4/project4.php

    I'm trying to set the clip rectangle in the function clipPicIn().

    Thanks,
    - Shawn
    MCP, VB6: Desktop Apps
    [ C# | VB | .NET | Java | VC++ | Perl | PHP | Javascript ]
    Unless otherwise stated, all sample code provided is UNTESTED.
    http://www.codemastershawn.com

  2. #2
    Join Date
    Jan 2003
    Location
    North Carolina
    Posts
    309
    The easiest way I know if is Transitions using the Square iris.

    Look here DHTML Objects and goto the IMG item, then look at filters.

  3. #3
    Join Date
    Aug 2002
    Location
    Washington, USA
    Posts
    104
    Thanks for the tip, but I am looking explicitly to use the clip functionality of the CSS standard. This code needs to run in all browsers, not just IE.

    (In other words, I'm not looking for the "easy" way - I'm looking for the "proper" way.)
    - Shawn
    MCP, VB6: Desktop Apps
    [ C# | VB | .NET | Java | VC++ | Perl | PHP | Javascript ]
    Unless otherwise stated, all sample code provided is UNTESTED.
    http://www.codemastershawn.com

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

Featured