home *** CD-ROM | disk | FTP | other *** search
- PROGRAM Test;
-
- {$I a:gemsubs.pas }
-
- VAR
- Other, X, Y : Short_Integer ;
- PValue, CIndex : Short_Integer ;
- c : Char ;
- TCol : Short_Integer;
- PValuestring, CIndexstring, mystring :Str255 ;
-
-
- PROCEDURE StNum( VAR It : Str255; Other : Short_Integer ) ;
- VAR Temp1, Temp2 : Str255;
- BEGIN
- Temp1 := Chr( ( Other DIV 10 ) + 48 ) ;
- Temp2 := Chr( ( Other MOD 10 ) + 48 ) ;
- It := Concat(Temp1, Temp2);
- END;
-
- PROCEDURE Get_Pixel_Value( X, Y : Short_Integer ;
- VAR PV, CI : Short_Integer ) ;
-
- VAR
- Ctrl : Ctrl_Parms ;
- Int_In : Int_In_Parms ;
- Int_Out : Int_Out_Parms ;
- Pts_In : Pts_In_Parms ;
- Pts_Out : Pts_Out_Parms ;
-
- BEGIN { Get_Pixel_Value }
-
- Ctrl[1] := 1 ;
- Ctrl[3] := 0 ;
- Pts_In[0] := X ;
- Pts_In[1] := Y ;
-
- VDI_Call( 105, 0, 0, 2, Ctrl, Int_In, Int_Out,
- Pts_In, Pts_Out, False ) ;
-
- PV := Int_Out[0] ;
- CI := Int_Out[1] ;
-
- END ; { Get_Pixel_Value }
-
- PROCEDURE Test_Screen ;
-
- VAR
- Index : Short_Integer ;
- Cur_Col : Short_Integer ;
- Offset : Short_Integer;
-
- BEGIN { Test_Screen }
-
- Clear_Screen ;
- Set_Clip( 0, 0, 320, 200 ) ;
- Line_Style( 1 ) ;
- Draw_Mode( 1 ) ;
- Cur_Col := 0 ;
- Offset := 0 ;
-
- REPEAT
-
- FOR Index := 0 TO 10 DO
- BEGIN
- Line_Color( Cur_Col ) ;
- Line( 0, Index + Offset , 319, Index + Offset ) ;
- END ;
- Cur_Col := Cur_Col + 1 ;
- Offset := Offset + 12 ;
- UNTIL Cur_Col = 16 ;
- END ;
-
- BEGIN { Main - Test }
-
- IF Init_Gem >= 0 THEN
- BEGIN
- Test_Screen ;
- Y := 5 ;
- X := 30 ;
- TCol := 15 ;
-
- REPEAT
- Get_Pixel_Value( X, Y, PValue, CIndex ) ;
- Text_Color( TCol ) ;
- StNum( PValuestring, PValue ) ;
- StNum( CIndexstring, CIndex ) ;
- mystring := concat('Pixel Value = ',PValuestring,
- ' Col Index = ',CIndexstring);
-
- Draw_String( X, Y, mystring) ;
-
- Read( c ) ;
- Y := Y + 12 ;
- TCol := TCol - 1 ;
- IF TCol = 0 THEN TCol := 1;
- UNTIL Y >= 200 ;
- Exit_Gem;
-
- END;
- END.
-