- add scaleX/scaleY to the method index and gives them some examples
authorTony Cook <tony@develop=help.com>
Thu, 10 Feb 2005 12:50:44 +0000 (12:50 +0000)
committerTony Cook <tony@develop=help.com>
Thu, 10 Feb 2005 12:50:44 +0000 (12:50 +0000)
Changes
Imager.pm
lib/Imager/Transformations.pod

diff --git a/Changes b/Changes
index 4dded524ef51c03b6a473ed5e95c5e1c05811eeb..b7f4375b3f80feccf7ce2d69eb24363c5e3cd425 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1013,6 +1013,7 @@ Revision history for Perl extension Imager.
   calculated correctly, this would cause the bounding_box() function for 
   freetype 2.x to return a larger than expected text width.
   http://rt.cpan.org/NoAuth/Bug.html?id=11291
+- add scaleX/scaleY to the method index and gives them some examples
 
 =================================================================
 
index 379548158abe0bb04938694b90ca2db1f4946bff..d1c5ea087cdb256ed89045a876aaee47537758c5 100644 (file)
--- a/Imager.pm
+++ b/Imager.pm
@@ -2920,6 +2920,10 @@ image and use the alpha channel
 
 scale() - L<Imager::Transformations/scale>
 
+scaleX() - L<Imager::Transformations/scaleX>
+
+scaleY() - L<Imager::Transformations/scaleY>
+
 setcolors() - L<Imager::ImageTypes> - set palette colors in a paletted image
 
 setpixel() - L<Imager::Draw/setpixel and getpixel>
index 0867179c1f9887f273121bc2e648b9f7d85f7656..dcda8b30d46ab0d2508e26eabcd72a2120433981 100644 (file)
@@ -13,6 +13,11 @@ Imager::Transformations - Simple transformations of one image into another.
   $newimg = $img->scale(xpixels=>400, ypixels=>400, type=>'min');
   $newimg = $img->scale(scalefactor=>0.25);
 
+  $newimg = $img->scaleX(pixels=>400);
+  $newimg = $img->scaleX(scalefactor=>0.25);
+  $newimg = $img->scaleY(pixels=>400);
+  $newimg = $img->scaleY(scalefactor=>0.25);
+
   $newimg = $img->crop(left=>50, right=>100, top=>10, bottom=>100); 
   $newimg = $img->crop(left=>50, top=>10, width=>50, height=>90);
 
@@ -76,6 +81,10 @@ if you want to keep an original after doing something that changes the image.
 
 =item scale
 
+=item scaleX
+
+=item scaleY
+
 To scale an image so porportions are maintained use the
 C<$img-E<gt>scale()> method.  if you give either a xpixels or ypixels
 parameter they will determine the width or height respectively.  If
@@ -103,6 +112,11 @@ If you need to scale images per axis it is best to do it simply by
 calling scaleX and scaleY.  You can pass either 'scalefactor' or
 'pixels' to both functions.
 
+  $newimg = $img->scaleX(pixels=>400); # 400x500
+  $newimg = $img->scaleX(scalefactor=>0.25) # 175x500
+  $newimg = $img->scaleY(pixels=>400); # 700x400
+  $newimg = $img->scaleY(scalefactor=>0.25) # 700x125
+
 =item crop
 
 Another way to resize an image is to crop it.  The parameters to