Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

PUTIMAGE, PUTIMAGE_W

Graphics Subroutines: Transfer the image stored in memory to the screen. These routines are only available for Windows.

Module

USE IFQWIN

CALL PUTIMAGE (x,y,image,action)

CALL PUTIMAGE_W (wx,wy,image,action)

x, y

(Input) INTEGER(2). Viewport coordinates for upper-left corner of the image when placed on the screen.

wx, wy

(Input) REAL(8). Window coordinates for upper-left corner of the image when placed on the screen.

image

(Input) INTEGER(1). Array of single-byte integers. Stored image buffer.

action

(Input) INTEGER(2). Interaction of the stored image with the existing screen image. One of the following symbolic constants defined in IFQWIN.F90:

  • $GAND - Forms a new screen display as the logical AND of the stored image and the existing screen display. Points that have the same color in both the existing screen image and the stored image remain the same color, while points that have different colors are joined by a logical AND.

  • $GOR - Superimposes the stored image onto the existing screen display. The resulting image is the logical OR of the image.

  • $GPRESET - Transfers the data point-by-point onto the screen. Each point has the inverse of the color attribute it had when it was taken from the screen by GETIMAGE, producing a negative image.

  • $GPSET - Transfers the data point-by-point onto the screen. Each point has the exact color attribute it had when it was taken from the screen by GETIMAGE.

  • $GXOR - Causes points in the existing screen image to be inverted wherever a point exists in the stored image. This behavior is like that of a cursor. If you perform an exclusive OR of an image with the background twice, the background is restored unchanged. This allows you to move an object around without erasing the background. The $GXOR constant is a special mode often used for animation.

  • In addition, the following ternary raster operation constants can be used (described in the online documentation for the Windows* API BitBlt):

    • $GSRCCOPY (same as $GPSET)

    • $GSRCPAINT (same as $GOR)

    • $GSRCAND (same as $GAND)

    • $GSRCINVERT (same as $GXOR)

    • $GSRCERASE

    • $GNOTSRCCOPY (same as $GPRESET)

    • $GNOTSRCERASE

    • $GMERGECOPY

    • $GMERGEPAINT

    • $GPATCOPY

    • $GPATPAINT

    • $GPATINVERT

    • $GDSTINVERT

    • $GBLACKNESS

    • $GWHITENESS

PUTIMAGE places the upper-left corner of the image at the viewport coordinates (x, y). PUTIMAGE_W places the upper-left corner of the image at the window coordinates (wx, wy).

Example

 ! Build as a Graphics App.
 USE IFQWIN
 INTEGER(1), ALLOCATABLE :: buffer(:)
 INTEGER(2) status, x
 INTEGER(4) imsize

 status = SETCOLOR(INT2(4))

 ! draw a circle
 status = ELLIPSE($GFILLINTERIOR,INT2(40),INT2(55),    &
                   INT2(70),INT2(85))
 imsize = IMAGESIZE (INT2(39),INT2(54),INT2(71), &
                   INT2(86))
 ALLOCATE (buffer(imsize))
 CALL GETIMAGE(INT2(39),INT2(54),INT2(71),INT2(86),    &
               buffer)

 ! copy a row of circles beneath it
 DO x = 5 , 395, 35
    CALL PUTIMAGE(x, INT2(90), buffer, $GPSET)
 END DO
 DEALLOCATE(buffer)
 END