var CharLoc:integer; {Global variable, initially zero} macro 'Import HiPic FileÉ'; { Based on "Import Image TIFF File". } var width,height,offset:integer; begin width:=1024; height:=1; offset:=0; SetImport('8-bit; Swap'); SetCustom(width,height,offset); Import(''); {Read in header as an image, prompting for the file name.} offset := (GetPixel(3,0)*256) + GetPixel(2,0); if not ((offset>0) and (offset<32386)) then offset := (GetPixel(2,0)*256) + GetPixel(3,0); offset := offset+64; width := (GetPixel(5,0)*256) + GetPixel(4,0); if not ((width>0) and (width<32386)) then width := (GetPixel(4,0)*256) + GetPixel(5,0); height := (GetPixel(7,0)*256) + GetPixel(6,0); if not ((height>0) and (height<32386)) then height := (GetPixel(6,0)*256) + GetPixel(7,0); SelectPic(nPics); {The ID of the last window opened is equal to nPics.} Dispose; SetImport('16-bit Unsigned'); SetCustom(width,height,offset); Import(''); {No prompt this time; Import remembers the name.} end;