ScreenViewPort
ScreenViewPort X1, Y1, X2, Y2
 
Parameters:

    X1 = The top left hand X position of the viewport
    Y1 = The top left hand Y position of the viewport
    X2 = The bottom right hand X position of the viewport
    Y2 = The bottom right hand Y position of the viewport
Returns: NONE
 

     ScreenViewPort lets you set the rendering boundaries of the screen. These boundaries take effect when graphics are being drawn to the screen.

      The viewport is the clipping boundary. Normally when you draw to the screen, those graphics will be clipped to the bounding edges of the screen.. What setting the viewport does, is it allows you to choose a section of the screen that you'd like all future drawing operations to be drawn within (clipped against). This allows us to render graphics to a certain area within an screen, without effective what's outside the area.




FACTS:


      * Applying a ViewPort to the Screen effects when the Image is being rendered to !.

      * By default the screens viewport will be set to 0,0,ScreenWidth,ScreenHeight




Mini Tutorial:


      Create an image, change it's viewport, and show the effects of the change.

  
; Clear the Screen to the bluey colour
  Cls RGB(0,100,255)
  
; Set the screens Viewport (clipping area) 50x,50y, 200x,200y
  ScreenViewPort 50,50,200,200
  
; Clear the screen (clipped to the view port) to a green colour
  Cls RGB(0,200,0)
  
; Draw a bunch of circles to the screen
  For lp =0 To 100
     CircleC Rnd(250),Rnd(250),Rnd(20),1,RndRGB()
  Next
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  
  


This example would output.

  
  no Text output
  


 
Related Info: GetImageViewPortX1 | GetImageViewPortX2 | GetImageViewPortY1 | GetImageViewPortY2 | ImageViewPort :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com