DIRECTORY AIS, Graphics, GraphicsOps, IO, Rope; BMToAIS: PROGRAM IMPORTS AIS, Graphics, GraphicsOps, Rope = BEGIN ROPE: TYPE = Rope.ROPE; Bitmap: TYPE = GraphicsOps.BitmapRef; fRef: AIS.FRef; w: AIS.WRef; raster: AIS.Raster _ NEW [AIS.RasterPart]; Write: PROC [fileName: ROPE, bm: Bitmap, bitsPerPixel: CARDINAL] = BEGIN raster^ _ [ scanCount: bm.height, scanLength: bm.width, scanMode: rd, bitsPerPixel: bitsPerPixel, linesPerBlock: -1, paddingPerBlock: 0]; fRef _ AIS.CreateFile[name: fileName, raster: raster]; w _ AIS.OpenWindow[f: fRef]; FOR line: INTEGER IN [0 .. INTEGER[bm.height]) DO TRUSTED { AIS.UnsafeWriteLine[ w: w, buffer: [ length--in words, right?--: bm.raster, addr: LOOPHOLE[bm.base, LONG POINTER] + LONG[bm.raster]*line], line: line]}; ENDLOOP; AIS.CloseWindow[w]; AIS.CloseFile[fRef]; END; WriteEyes: PROC [prefix: ROPE, allEyes: Bitmap, size, upset: INTEGER] = BEGIN DoIt: PROC [view: ROPE, pos: INTEGER] = BEGIN GraphicsOps.DrawBitmap[self: context, bitmap: allEyes, w: 64, h: 64, x: pos*64, y: 0, xorigin: pos*64, yorigin: 64]; Write[prefix.Cat[view, ".AIS"], single, 0]; END; single: Bitmap _ GraphicsOps.NewBitmap[size, size]; context: Graphics.Context _ GraphicsOps.NewContextFromBitmap[single]; Graphics.SetCP[context, (size-64)/2, upset]; DoIt["Left", 0]; DoIt["Right", 1]; DoIt["Back", 2]; DoIt["Front", 3]; END; END. HBMToAIS.Mesa Last Edited by: Spreitzer, January 12, 1984 9:08 pm Κ – "cedar" style˜J™ Jšœ3™3J˜IcodešΟk œœœ˜/K˜šΠbxœ˜Kšœœ˜*—K˜Kš˜K˜Kšœœœ˜Kšœœ˜%K˜Kšœœ˜Kšœœ˜ Kšœœ œœ ˜*K˜šΟnœœ œœ˜BKš˜˜ K˜K˜K˜ Kšœ˜K˜K˜—Kšœœ,˜6Kšœœ˜š œœœœ ˜1šœ˜ šœ˜K˜šœ ˜ KšœΟcœ ˜&Kš œœ œœœ˜>—K˜ ——Kšœ˜—Kšœ˜Kšœ˜Kšœ˜—K˜šŸ œœ œ œ˜GKš˜šŸœœœœ˜'Kš˜K˜tK˜+Kšœ˜—K˜3KšœE˜EK˜,K˜K˜K˜K˜Kšœ˜—K˜Kšœ˜—…—N’