我有一个div。该div显示图像。图像显示为从较大图像切割的精灵,如下所示:
$output_dir = DOCUMENT_ROOT."/uploads/";
$file = $_FILES['resume'];
if($_FILES['resume']['name'] != "") {
$allowedExts = array("pdf", "doc");
$extension = end(explode(".", $_FILES["resume"]["name"]));
if (
($_FILES["resume"]["type"] == "application/pdf") ||
($_FILES["resume"]["type"] == "application/msword") ||
($_FILES["resume"]["type"] == "application/vnd.openxmlformats-officedocument.wordprocessingml.document") &&
($_FILES["resume"]["size"] < 20000000) && in_array($extension, $allowedExts)
) {
move_uploaded_file($_FILES["resume"]["tmp_name"],$output_dir.$_FILES["resume"]["name"]);
$value['resume'] = $_FILES["resume"]["name"];
$this->xyz_model->update_tabel_user_data($user_id,$value);
redirect(site_url(user/demo'));
}
}
div大小为16x16。我希望将div大小增加到32x32,从myBiggerImage.jpg切下16x16片段,从现在的位置开始,缩放2次,以适应32x32 div。
如何完成它?