Wallpaper Macro |
This macro is based on the Tile macro, except
that instead of taking the current frame and reducing it down to fit inside
the image, it takes the image and multiplies it up, increasing the resolution
of the image.
|
image Wallpaper(image img, int nXTile, int nYTile ) { image oneTile = Crop(Crop(img, 0,0,width,height),0,0,width*nXTile,height*nYTile); image oneRow = oneTile; for (int i=1; i<nXTile; ++i) { oneRow = Over(Pan(oneTile, width/nXTile*i,0,0,0,0), oneRow, 0); if (nYTile>1 || i <nXTile-1) { SetCacheMode(oneRow, 0); } } oneTile = oneRow; for (int j=1; j<nYTile; ++j) { oneRow = Over(Pan(oneTile, 0,height/nYTile*j,0,0,0), oneRow, 0); if (j <nYTile-1) { SetCacheMode(oneRow, 0); } } return oneRow; }
|