|
© Efflare Systems website : e-mail |
<cfx_imageflare source="
b = Bitmap('#expandpath('.\watch.jpg')#')
b.resize(200,0)
b.save('#expandpath('.\example02a.jpg')#')
">
![]() |
In this example we create a Bitmap object with
Bitmap('#expandpath('.\watch.jpg')#').
As the ImageFlare API denotes, this constructor loads the named image into the new Bitmap object immediately. We then resize and save the image. You'll notice the second argument of the resize function is 0. As the API states, when either the width or height is zero, it will be calculated automatically keeping the image proportion the same. |
<cfx_imageflare source="
b = Bitmap( '#expandpath('.\tc.jpg')#' )
b.resize( 0, 150 )
b.crop( (b.width/2)-75, 0, (b.width/2)+75, 150 )
b.save( '#expandpath('.\example02b.jpg')#' )
">
![]() |
In this example we do something a little bit different.
After resizing the image we crop it with :
b.crop( (b.width/2)-75, 0, (b.width/2)+75, 150 )
This basically cuts out the middle section of the image, so it is not too wide. If you look at the original tc.jpg you can see it is proportionately wide. The above script cuts an optimal square from the middle of the image for the resulting thumbnail. The following progression demonstrates this process : |
| Original thumbnail... | Cropping... | Fin. | ||
![]() |
![]() |
![]() |