! MDL 02/93 RASTER.BAS ! ! A simplistic example of raster graphics for the HP PROGRAM RASTER OPTION TYPE = EXPLICIT, & SIZE = (REAL DOUBLE, INTEGER LONG), & CONSTANT TYPE = INTEGER EXTERNAL STRING FUNCTION PCL_Raster_Mode, & PCL_Raster_Height, & PCL_Raster_Width, & PCL_Raster_Command, & PCL_Raster_Y_Offset, & PCL_Raster_Resolution, & PCL_Raster_Compression, & PCL_Raster_Repeat, & PCL_Raster_Zero_Row, & PCL_Raster_Unencoded_Data, & PCL_Raster_End, & PCL_Init_Page, & PCL_Position_Cursor EXTERNAL LONG FUNCTION String_To_Byte DECLARE LONG Raster_Data(3), & Loop1, & Loop2 DECLARE STRING R(17) open "raster.pcl" for output as 11, organization sequential variable, & recordtype none ! The image R(0) = "00001111111111111111111111110000" R(1) = "00010000000000000000000000001000" R(2) = "00100000000000000000000000000100" R(3) = "01000011100000000000000111000010" R(4) = "10000111110000000000001111100001" R(5) = "10000011100000000000000111000001" R(6) = "10000000000000000000000000000001" R(7) = "10000000000000010000000000000001" R(8) = "10000000000000111000000000000001" R(9) = "10000000000000111000000000000001" R(10) = "10000000000000010000000000000001" R(11) = "10000000000000000000000000000001" R(12) = "10000110000000000000000001100001" R(13) = "10000011000000000000000011000001" R(14) = "01000001100000000000000110000010" R(15) = "00100000011111111111111100000100" R(16) = "00010000000000000000000000001000" R(17) = "00001111111111111111111111110000" PRINT #11, ESC;"E"; ! Location PRINT #11, PCL_Position_Cursor(300,300); ! Resolution PRINT #11, PCL_Raster_Resolution(300); ! Setup for raster graphics PRINT #11, PCL_Raster_Mode(0); PRINT #11, PCL_Raster_Command(1); PRINT #11, PCL_Raster_Compression(0); ! Convert and send the image FOR Loop1 = 0 TO 17 FOR Loop2 = 1 TO 4 Raster_Data(0) = String_To_Byte(SEG$(R(Loop1),1,8)) Raster_Data(1) = String_To_Byte(SEG$(R(Loop1),9,16)) Raster_Data(2) = String_To_Byte(SEG$(R(Loop1),17,24)) Raster_Data(3) = String_To_Byte(SEG$(R(Loop1),25,32)) NEXT Loop2 PRINT #11, PCL_Raster_Unencoded_Data(4,Raster_Data(),1); NEXT Loop1 ! Turn off raster graphics PRINT #11, PCL_Raster_END; ! All done PRINT #11, ESC;"E" close 11 end