CompuServe Messages

How to Wallpaper?

    23-Feb-95 10:27:36
Fm: John Toebes/SYSOP 70007,3467
To: Steve Ahlstrom 76703,2006
Sorry, I must have misread your original message… I'm assuming you can get the IFF into memory, and have established a bitmap structure for it… if you need help with that, say so and I'll go into that (usually I just use Jim Kent's Jiff.c to load IFFs for me, but it's ancient)… TileMe(struct Window *TileWin,struct BitMap *TileBitMap, int sizex, int sizey) { int i,j; struct Rastport *WRP = TileWin->RPort; struct Rastport TileRP = {0}; InitRastPort(&TileRP); TileRP.BitMap = &TileBitMap; /* make sure the window is bigger than the source; sizex and sizey can be calculated from the TileBitMap structure */ if(TileWin->Height < sizey && TileWin->Width < sizex) { for(j = 0;j < TileWin->Height;j += sizey) { for(i = 0; i < TileWin->Width;i += sizex) { ClipBlit(&TileRP,0,0,WRP,i,j,sizex,sizey,0xff); } } } That's one way, the first that occurred to me. But, while I was typing it, an easier method came to mind… Just make an Image, like you do for gadgets… TileMe(struct Window *TileWin, struct Image *TileImage) { int i,j; for(j = 0;j < TileWin->Height;j += TileImage->Height) { for(i = 0;i < TileWin->Width;i += TileImage->Width) { DrawImage(TileWin->RPort,TileImage,i,j); } } } That's probably the best (easiest) way to do it. I had to do similar things for the gui for a video controller program I did years ago; unfortunately, the source got dumped when I needed room on my HD some time ago. Sorry for misunderstanding, before.