Image Structures
02-Jan-92 06:39:29
Sb: #18593-Image Structures
Fm: John Toebes/SYSOP 70007,3467
To: Rodger Padgett 76130,514
Well, there are 2 parts to the Image structure.
The ImageData for the structure must reside in chip ram and consist of word
aligned bits (i.e. rounded up to the nearest double byte boundary). To get
something like a square we would have:
__chip USHORT idata[] = {
/* **** **** **.. …. */ 0xFFC0,
/* **.. …. **.. …. */ 0xC0C0,
/* **.. …. **.. …. */ 0xC0C0,
/* **.. …. **.. …. */ 0xC0C0,
/* **.. …. **.. …. */ 0xC0C0,
/* **.. …. **.. …. */ 0xC0C0,
/* **.. …. **.. …. */ 0xC0C0,
/* **** **** **.. …. */ 0xFFC0
};
Next you need the image structure itself. This does NOT have to be in chip
ram and can be simply declared as:
struct Image MyImage = {
0, 0, 10, 8, 1, /* Left, top, width, height, depth */
idata, /* Location of your image data in chip ram */
0, 0, NULL }; /* PlanePick, PlaneOnOff, Next Image */
Note that the width in this case is 10 because that is how large our data
is. The system will automatically skip to the next word to get the next
row of data.
John A. Toebes, VIII – via Whap!