home *** CD-ROM | disk | FTP | other *** search
/ Sauce 'n' Code 3 / sauce-n-code-03.adf / Source_Code / Screen_Zoom_In.asc < prev    next >
Text File  |  1996-01-21  |  1KB  |  73 lines

  1. ' Zoom In  
  2. ' ¯¯¯¯¯¯¯  
  3. ' cODED bY ßudda/NFA 
  4. ' StARtEd : 15/10/1995 
  5. ' FiNiSHed: 15/10/1995 
  6.  
  7. Load "scr_man.abk"
  8.  
  9. ' --- demonstrational picture
  10. Unpack 5 To 0
  11. Screen Hide 0
  12.  
  13. ' --- save details about screen
  14. SH=Screen Height(0)
  15. SW=Screen Width(0)
  16. SC=Screen Colour
  17. SM=Screen Mode
  18.  
  19. ' --- variable variables!! try changing them 
  20. SPEED=10
  21. _ZOOM=SW*2 : Rem zoom in x2 
  22.  
  23. ' --- open temp screen to work on  
  24. Screen Open 2,SW,SH,SC,SM
  25. Flash Off 
  26. Curs Off 
  27. Screen Hide 2
  28.  
  29. ' --- open screen to see it all on 
  30. Screen Open 1,SW,SH,SC,SM
  31. Flash Off 
  32. Curs Off 
  33. Hide On 
  34. Get Palette 0
  35. Double Buffer 
  36. Autoback 0
  37.  
  38. ' --- actual stretch code (very small?!) 
  39. For SCAN#=SW To _ZOOM Step SPEED
  40.    
  41.    ' - horizontal calculations
  42.    LIN1#=SW/SCAN#
  43.    OFFSET1=(SW/2)-(SW/LIN1#)/2
  44.    For XXX#=0 To SW Step(LIN1#*SPEED)
  45.       Screen Copy 0,XXX#,0,XXX#+SPEED,SH To 2,OFFSET1,0
  46.       Add OFFSET1,SPEED
  47.    Next XXX#
  48.    
  49.    ' - verticle calculations
  50.    LIN2#=SH/SCAN#
  51.    OFFSET2=(SH/2)-((SH/LIN2#)/2)
  52.    For YYY#=0 To SH Step(LIN2#*SPEED)
  53.       Screen Copy 2,0,YYY#,SW,YYY#+SPEED To 1,0,OFFSET2
  54.       Add OFFSET2,SPEED
  55.    Next YYY#
  56.  
  57.    Screen Swap 
  58.    Wait Vbl 
  59. Next SCAN#
  60.  
  61.  
  62. ' The higher the SPEED number the more crap the zoomed graphics look.  HOWEVER 
  63. ' if the speed is faster then the zoom looks much smoother/quicker and nobody  
  64. ' will notice if you do it fast enough to show the effect but not sit and
  65. ' look at it !!! 
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.