Visible to Intel only — GUID: GUID-995030B6-C921-41E4-8E9B-287591B76BDE
Special Naming Convention for Certain QuickWin and Windows* Graphics Routines
Comparing QuickWin with Windows*-Based Applications
Using Windows API Routines with QuickWin
Types of QuickWin Programs
The QuickWin User Interface
USE Statement Needed for Fortran QuickWin Applications
Creating QuickWin Windows
Using QuickWin Graphics Library Routines
Selecting Display Options
Checking the Current Graphics Mode
Setting the Graphics Mode
Setting Figure Properties
Understanding Coordinate Systems
Adding Color
Writing a Graphics Program
Displaying Graphics Output
Storing and Retrieving Images
Customizing QuickWin Applications
QuickWin Programming Precautions
Simulating Nonblocking I/O
Visible to Intel only — GUID: GUID-995030B6-C921-41E4-8E9B-287591B76BDE
Drawing a Sine Curve
With the axes and frame in place, Writing a Graphics Program Overview is ready to draw the sine curve. The sinewave routine calculates the x and y positions for two cycles and plots them on the screen:
! SINEWAVE - This subroutine calculates and plots a sine wave. SUBROUTINE sinewave( ) USE IFQWIN INTEGER(2) dummy, newx, newy, locx, locy, i INTEGER(4) color REAL rad EXTERNAL newx, newy PARAMETER ( PI = 3.14159 ) ! ! Calculate each position and display it on the screen. color = #0000FF ! red ! DO i = 0, 999, 3 rad = -SIN( PI * i / 250.0 ) locx = newx( i ) locy = newy( INT2( rad * 250.0 ) ) dummy = SETPIXELRGB( locx, locy, color ) END DO END SUBROUTINE
SETPIXELRGB takes the two location parameters, locx and locy, and sets the pixel at that position with the specified color value (red).
Parent topic: Writing a Graphics Program