GetSurfaceHeight
Height = GetSurfaceHeight()
 
Parameters: NONE
Returns:

    Height= The Height of the current surface in pixels
 

      The GetSurfaceHeight() function returns the Height of the current drawing surface.



FACTS:

      * None



Mini Tutorial:


      This example uses the GetSurface commands to get some basic information about the current drawing surface


  
  
  
; Display the info about the default surface
  Display_Current_Surface_info_to_Screen(50,50)
  
  
; Create a new image
  CreateImage 1,200,100
  
; Set this new image as the Current drawing surface
  RenderToImage 1
  
  
  Display_Current_Surface_info_to_Screen(50,200)
  
  
; Show the screen to the user and wait for a key press
  Sync
  WaitKey
  
  
  
  
Function Display_Current_Surface_info_to_Screen(Xpos,Ypos)
  
; Get the curret drawing surface index
  SurfaceIndex=GetSurface()
; get the current drawing surfaces width
  Width=GetSurfaceWidth()
; get the current drawing surfaces Height
  Height=GetSurfaceHeight()
  
  If SurfaceINdex=0
     Name$="[Screen]"
  Else
     Name$="[Image]"
  EndIf
  
  
; Make the Screen the current drawing surface
  RenderToScreen
  
; Display the info at this position
  Text xpos,ypos,   "Surface Name:"+name$
  Text xpos,ypos+20,"===================="
  Text xpos,ypos+40," Surface:"+Str$(SurfaceIndex)
  Text xpos,ypos+60,"   Width:"+Str$(Width)
  Text xpos,ypos+80,"  Height:"+Str$(Height)
  
; Restore the original drawing surface
  RenderToImage SurfaceIndex
  
EndFunction
  
  




This example would output.

  
  
  Surface Name:[screen]
  ====================
  Surface:0
  Width:800
  Height:600
  
  
  Surface Name:[Image]
  ====================
  Surface:1
  Width:200
  Height:100
  
  
  

 
Related Info: GetSurface | GetSurfaceStatus | GetSurfaceWidth | RenderToImage | RenderToScreen :
 


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