/*
*要添加到图像缩略图版本的字符串
*/
public thumb_marker='_thumb'
/*
*图形库的路径(如果适用)
*/
public library_path='';
/*
*资源图片
*/
public source_image='';
/*
*修改图像的路径,就是创建副本文件,源文件将保留
*/
public new_image='';
/*
*修改后的图片宽度
*/
pubilc width=''';
/*
*修改后的图片高度
*/
public height='';
/*
*旋转图片角度
*/
public rotation_angle='';
/*
*图片X坐标
*/
public x_axis='';
*/
/*
*图片Y坐标
*/
public y_axis='';
//下面数组未写完
//下面的方法是初始化上面成员变量,如果在循环中使用就是重置的作用
function clear()
{
$props=array('thumb_marker','library_path','source_image','new_image','width','height','rotation_angle','x_axis','y_axis','wm_text','wm_overlay_path','wm_font_path','wm_shadow_color','source_folder','dest_folder','mime_type','orig_width','orig_height','image_type','size_str','full_str_path','full_dst_path');
foreach($props as $val)
{
$this->$val='';
}
$this->image_library='gd2';
$this->dynamic_output=false;
$this->quality=90;
$this->create_thumb=false;
$this->thumb_marker='_thumb';
$this->maintain_ratio=true;
$this->master_dim='auto';
$this->wm_type='text';
$this->wm_x_transp=4;
$this->wm_y_transp=4;
$this->wm_font_size=17;
$this->wm_vrt_alignment='B';
$this->wm_hor_alignment='C';
$this->wm_padding=0;
$this->wm_hor_offset=0;
$this->wm_vrt_offset=0;
$this->wm_shadow_distance=2;
$this->wm_opacity=50;
$this->wm_font_color='#ffffff';
$this->create_fnc='imagecreatetruecolor';
$this->copy_fnc='imagecopyresampled';
$this->error_msg=array();
$this->wm_use_drop_shadow=false;
$this->wm_use_truetype=false;
}
}
php用数组初始化成员变量,在循环中使用就起重置的作用
最新推荐文章于 2024-08-13 15:52:19 发布