viewport(3f) - [M_pixel] Specify which part of the screen to draw in. (LICENSE:PD)
Synopsis
Description
Example
Author
License
definition:
subroutine viewport(left, right, bottom, top) real,intent(in) :: left, right, bottom, top
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)
Sample program
program demo_viewport use :: M_pixel use :: M_pixel__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 viewportcall 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
John S. Urban
Public Domain
Nemo Release 3.1 | viewport (3m_pixel) | April 21, 2023 |