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

ID 767251
Date 3/22/2024
Public

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

Document Table of Contents

SETPIXELS

Graphics Subroutine: Sets the color indexes of multiple pixels. This routine is only available for Windows.

Module

USE IFQWIN

CALL SETPIXELS (n, x, y, color)

n

(Input) INTEGER(4). Number of pixels to set. Sets the number of elements in the other arguments.

x, y

(Input) INTEGER(2). Parallel arrays containing viewport coordinates of pixels to set.

color

(Input) INTEGER(2). Array containing color indexes to set the pixels to.

SETPIXELS sets the pixels specified in the arrays x and y to the color indexes in color. These arrays are parallel: the first element in each of the three arrays refers to a single pixel, the second element refers to the next pixel, and so on.

If any of the pixels are outside the clipping region, those pixels are ignored. Calls to SETPIXELS with n less than 1 are also ignored. SETPIXELS is a much faster way to set multiple pixel color indexes than individual calls to SETPIXEL.

Unlike SETPIXELS, SETPIXELSRGB gives access to the full color capacity of the system by using direct color values rather than indexes to a palette. The non-RGB color functions (such as SETPIXELS and SETCOLOR) use color indexes rather than true color values.

If you use color indexes, you are restricted to the colors available in the palette, at most 256. Some display adapters (SVGA and true color) are capable of creating 262,144 (256K) colors or more. To access any available color, you need to specify an explicit RGB value with an RGB color function, rather than a palette index with a non-RGB color function.

Example

 ! Build as a Graphics ap.
     USE IFQWIN
     INTEGER(2) color(9)
     INTEGER(2) x(9), y(9), i
     DO i = 1, 9
       x(i) = 20 * i
       y(i) = 10 * i
       color(i) = INT2(i)
     END DO
     CALL SETPIXELS(9, x, y, color)
     END