spacer
Yehuda Shiran October 14, 2000
Stretching and Cropping Images
Tips: October 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
OpenOffice 3.2 Lands Amid Critical Changes
Red Hat, IBM Firmly in KVM Virtualization Camp
Red Hat Talks Up Open Source Cloud Plans

The AlphaImageLoader filter has been introduced in IE 5.5. It supports two properties: sizingMethod and src. The sizingMethod property can take three values:

  • "image": Keep the original size of the image.
  • "scale": Stretch or compress the image to the container boundaries.
  • "crop": Crop the image to the container dimensions.

The src property denotes the image file being operated by the filter.

The following demo shows three buttons that you can operate for trying out these three sizingMethod's options.


















Here is the code:

<SCRIPT>
<!--
function fnChangeFilter(oButton, sizingOption) {
        oDiv.filters(0).sizingMethod=sizingOption;
}
// -->
</SCRIPT>
        
    
<DIV ID="oDiv" STYLE="position:absolute; left:140px; height:150; width:200;         
  filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(
  SRC='sunset.jpg', sizingMethod='scale');" >
</DIV>

<BUTTON onclick="fnChangeFilter(this, 'image');">Original</BUTTON><BR>
<BUTTON onclick="fnChangeFilter(this, 'scale');">Compress</BUTTON><BR>
<BUTTON onclick="fnChangeFilter(this, 'crop');">Crop</BUTTON>

Learn more about filters in Column 69, Introduction to Filters.


People who read this tip also read these tips:

Look for similar tips by subject:


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

webref The latest from WebReference.com Browse >
Are Google's Language Translation Web Services Ready for Prime Time? · Installing and Using Meeplace, the Business Review CMS · Sending an HTML and Plain Text E-newsletter with ASP.NET, Part 2
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
ANSI SQL Hierarchical Data Processing Basics · Top 10 Threats to Wireless Security · Nuvio Intros NuvioFlex Virtual PBX