IMAGE Example


Example:

 

*

. IMAGE Example Program

.

PIC1

INIT

"GIRL2.PCX"

VMODE

FORM

"18"

*

.This displays in mode 18 (VGA) the largest image possible without

.causing distortion to occur using *SB & *PF defaults.

.

  

IMAGE

*MODE=VMODE,PIC1

*

 

 

.This displays in mode 40 (Super VGA).the largest image possible without

.causing distortion to occur using *SB & *PF defaults.

.

  

IMAGE

*MODE=40,PIC1

*

.This displays a window image in *MODE=40 with *SB & *PF specified.

.The contents of the text screen are redisplayed in graphics mode

.prior to displaying the image.

.

  

IMAGE

*REDISP,*MODE=40,*SB,*PF:

  

  

*SETIWALL=02:13:02:25,PIC1

*

.This displays a window image in the defined sub-window.

.

  

DISPLAY

*ES,*RED,*SETSWALL=01:14:01:26:

  

  

 *BORDER,*SHRINKSW;

  

IMAGE

*REDISP,*PF,*SB,*MODE=40,PIC1

*

.This displays a window image with *SO for one-to-one bit mapping.

.

  

DISPLAY

*SETSWALL=01:14:26:54,*BORDER,*SHRINKSW;

  

IMAGE

*MODE=VMODE,*PF,*SO,PIC1

*

 

 

. This displays a window image with *SS for stretch to fit mapping.

.

  

DISPLAY

*SETSWALL=01:14:54:80,*BORDER,*SHRINKSW;

  

IMAGE

*MODE=VMODE,*PF,*SS,PIC1

*

.This displays a window image with *SO and starting 100 pixels from

. the top of the image and 100 pixels from the left of the image.

.

  

IMAGE

*SETIWALL=16:24:27:53:

  

  

 *IMAGE=100:100,*PF,*SO:

  

  

 *MODE=VMODE,PIC1

*

. This displays an image using the palette in the file, wait for 5 seconds, and then

. 5 seconds, and then displays the image again with a common palette. Note that the

. image window established for the first image is still in effect for the second window.

. Also note that the result code for each picture is stored in a different variable.

.

  

IMAGE

*SETIWALL=16:24:27:53:

  

  

 *PF,*ERROR=ERR1,*MODE=VMODE,PIC1:

  

  

 *W=5,*TEXT,*PS,*ERROR=ERR2,PIC

 

 

This example illustrates various methods of displaying images using the IMAGE instruction.

 



PL/B Language Reference IFX Example IMAGEPRINT Example