Ec (2); & lt ;? FunctionsetMaskTxtPct ($ n) & nbsp; {& nbsp; $ this-& gt; mask_txt_pct (int) $ n; & nbsp ;}& nbsp; & nbsp; ** & nbsp; & script ec (2); script
Function setMaskTxtPct ($ n)
{
$ This-> mask_txt_pct = (int) $ n;
}
/**
* Set the thumbnail border
*
* @ Param (type) (parameter name) (description)
*/
Function setDstImgBorder ($ size = 1, $ color = "#000000 ")
{
$ This-> img_border_size = (int) $ size;
$ This-> img_border_color = $ color;
}
/**
* Horizontal flip
*/
Function flipH ()
{
$ This-> _ flip_x ++;
}
/**
* Vertical flip
*/
Function flipV ()
{
$ This-> _ flip_y ++;
}
/**
* Set the cut type.
*
* @ Param (type) (parameter name) (description)
*/
Function setCutType ($ type)
{
$ This-> cut_type = (int) $ type;
}
/**
* Set image cropping.
*
* @ Param integer $ width rectangular cut
*/
Function setRectangleCut ($ width, $ height)
{
$ This-> fill_w = (int) $ width;
$ This-> fill_h = (int) $ height;
}
/**
* Set the starting coordinate point of the source image cut.
*
* @ Param (type) (parameter name) (description)
*/
Function setSrcCutPosition ($ x, $ y)
{
$ This-> src_x = (int) $ x;
$ This-> src_y = (int) $ y;
}
/**
* Create an image. Main Function
* @ Param integer $ a when the second parameter is missing, this parameter is used as a percentage,
* Otherwise, it is used as the width value.
* @ Param integer $ B the scaled height of the image
*/
Function createImg ($ a, $ B = null)
{
$ Num = func_num_args ();
If (1 = $ num)
{
$ R = (int) $;
If ($ r <1)
{
Die ("image scaling ratio cannot be less than 1 ");
}
$ This-> img_scale = $ r;
$ This-> _ setNewImgSize ($ r );
}
If (2 = $ num)
{
$ W = (int) $;
$ H = (int) $ B;
If (0 = $ w)
{
Die ("the target width cannot be 0 ");
}
If (0 = $ h)
{
Die ("the Target Height cannot be 0 ");
}
$ This-> _ setNewImgSize ($ w, $ h );
}
If ($ this-> _ flip_x % 2! = 0)
{
$ This-> _ flipH ($ this-> h_src );
}
If ($ this-> _ flip_y % 2! = 0)
{
$ This-> _ flipV ($ this-> h_src );
}
$ This-> _ createMask ();
$ This-> _ output ();
// Release
If (imagedestroy ($ this-> h_src) & imagedestroy ($ this-> h_dst ))
{
Return true;
}
Else
{
Return false;
}
}
?>