forked from shenzhenjinma/sketch_to_html
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
31 lines (22 loc) · 894 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
function imagecropper($source_path)
{
$source_info = getimagesize($source_path);
$source_width = $source_info[0];
$source_height = $source_info[1];
$source_mime = $source_info['mime'];
$oldimg = imagecreatefrompng($source_path);
$base_width=350;
$base_height=6;
$baseimage = imagecreatetruecolor($base_width, $base_width);// 苹果图啊
$thisimage = imagecreatetruecolor($base_width, $base_height);
imagecopy($baseimage, $oldimg, 0, 0, 200, 642, $base_width, $base_height);
for ($i=0;$i<30;$i++){
imagecopy($baseimage, $oldimg, 0, $i*($base_height*2)-$base_height, 200, (642+($i*12)), $base_width, $base_height);
imagecopy($baseimage, $oldimg, 0, $i*($base_height*2), 200, (642+($i*12)), $base_width, $base_height);
}
header('Content-Type: image/png');
imagepng($baseimage);
}
imagecropper("http://127.0.0.1/888.png")
?>