[UP]


Manual Reference Pages  - viewport (3)

NAME

viewport(3f) - [M_pixel] Specify which part of the screen to draw in. (LICENSE:PD)

CONTENTS

Synopsis
Description
Example
Author
License

SYNOPSIS

definition:

   subroutine viewport(left, right, bottom, top)
   real,intent(in) :: left, right, bottom, top

DESCRIPTION

Specify which part of the screen to draw in. Left, right, bottom, and top are real values in screen coordinates (0:n,0:m).

If a pixel array has been declared to be real :: array(600,400)

        o-----> X                         (right=600,top=0)
        | #------------------------------------#
        | |                                    |
        | |                                    |
        V |                                    |
        Y |                                    |
          #------------------------------------#
(left=0,bottom=400)

EXAMPLE

Sample program

   program demo_viewport
   use :: M_pixel
   use :: M_writegif, only : writegif
   implicit none
      call prefsize(400, 400) ! set up drawing surface
      call vinit()
      call color(7)
      call linewidth(40)
      call clear()
      call ortho2(-88.0, 88.0, -88.0, 88.0)
      ! draw the same circle, just changing viewport

call viewport( 0.0, 200.0, 0.0, 200.0 ); call draw_circle(1) call viewport( 200.0, 400.0, 0.0, 200.0 ); call draw_circle(2) call viewport( 0.0, 200.0, 200.0, 400.0 ); call draw_circle(3) call viewport( 200.0, 400.0, 200.0, 400.0 ); call draw_circle(4) call viewport( 250.0, 350.0, 150.0, 300.0 ); call draw_circle(5)

call writegif(’viewport.3m_pixel.gif’,P_pixel,P_colormap) !call execute_command_line(’display viewport.3m_pixel.gif’) call vexit() contains subroutine draw_circle(icolor) integer,intent(in) :: icolor call color(0) call rect(-88.0,-88.0,88.0,88.0) call color(icolor) call makepoly() call circle(0.0,0.0,88.0) call closepoly() end subroutine draw_circle end program demo_viewport

AUTHOR

John S. Urban

LICENSE

Public Domain


viewport (3) March 11, 2021
Generated by manServer 1.08 from 2022a22f-5087-4130-b004-27e020be853b using man macros.