谢谢,
实际上我有点想法,并提出了正确的imagemagick咒语.
这是tcsh版本.
将图像切成4×4网格(结果图像编号为sequentual).数字系统被解释为:col + row*nrows:
$ convert -crop 25%x25% image.png tile-prefix.png
Run Code Online (Sandbox Code Playgroud)
通常需要将顺序编号重新映射到行x列.例如,如果您在iOS应用程序中使用CATiledLayer,则需要为给定的比例摄取正确的图块.这是如何做:
while ( $i < $number_of_tiles )
while -> set r = `expr $i \/ 4`
while -> set c = `expr $i \% 4`
while -> cp tile-prefix-$i.png tile-prefix-${r}x${c}.png
while -> echo $i
while -> @ i++
while -> end
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3039 次 |
| 最近记录: |