home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Vectronix 2
/
VECTRONIX2.iso
/
FILES_01
/
HP_550C.LZH
/
PRINT.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-06-27
|
4KB
|
181 lines
#include <stdio.h>
#include <stddef.h>
#include <stdlib.h>
#include <ext.h>
#include <aes.h>
#include <vdi.h>
#include <tos.h>
#include <ext.h>
#include <string.h>
#include <math.h>
#define TAILLE 75
int contrl[12]; /* vdi parameter arrays */
int intin[256];
int intout[128];
int ptsin[256];
int ptsout[128];
int work_in[11]; /* Input to GSX parameter array */
int work_out[57]; /* Output from GSX parameter array */
int buffer[8];
int h_char,l_char; /* hauteur et largeur des caracteres */
int hb_char,lb_char; /* hauteur et largeur de la boite contenant les caracteres */
int nb_couleur_vdi; /* nb de couleur supportées par le vdi sur cette station */
int hauteur_vdi,largeur_vdi; /*hauteur et largeur de l'écran utilisé */
int phys_handle,handle,menu_acc,vdi_handle,g_handle;
int ap_id;
int rgb[16][3];
int rgb2[2][3];
char txt[33]="";
int dummy, retour;
char filename[15]="D:\\ESSAI.IMG";
int aspect, x_scale, y_scale, h_align, v_align;
/*======================================================================*/
void open_vwork(void);
void open_work( void );
/* la classique ouverture de station de travail */
void open_work( void )
{
int i;
for (i=0;i<10;work_in[i++]=1);
work_in[10]=2;
work_in[0]=21;
v_opnwk(work_in,&handle,work_out);
nb_couleur_vdi=work_out[13]; /* nombre de couleur presentes */
hauteur_vdi=work_out[1]+1; /* largeur et hauteur de la virtual */
largeur_vdi=work_out[0]+1; /* workstation */
printf("%d\n",largeur_vdi);
printf("%d\n",hauteur_vdi);
printf("%d\n",nb_couleur_vdi);
printf("%d %d %d %d\n",h_char,l_char,hb_char,lb_char);
};
void open_vwork( void )
{
int i;
for (i=0;i<10;work_in[i++]=1);
work_in[10]=2;
v_opnvwk(work_in,&handle,work_out);
nb_couleur_vdi=work_out[13]; /* nombre de couleur presentes */
hauteur_vdi=work_out[1]+1; /* largeur et hauteur de la virtual */
largeur_vdi=work_out[0]+1; /* workstation */
};
void main( void )
{
int i, id;
int pxyarray[4];
open_vwork();
vst_load_fonts( handle, 0);
vswr_mode ( handle, MD_REPLACE);
for (i=1;i<nb_couleur_vdi;i++)
{
pxyarray[0]=0;
pxyarray[1]=0;
pxyarray[2]=largeur_vdi;
pxyarray[3]=hauteur_vdi;
vs_clip(handle, -1 ,pxyarray);
vq_color(handle,i,0,rgb[i]);
pxyarray[0]=(TAILLE * i)+100;
pxyarray[1]=100;
pxyarray[2]=pxyarray[0]+50;
pxyarray[3]=200;
vsf_color(handle,i);
v_rfbox(handle,pxyarray);
}
id = vqt_name( handle, 2, &txt);
printf("%s\n", txt);
vst_font( handle, id);
vst_arbpt( handle,12,&dummy,&dummy,&dummy,&retour);
printf("%d\n",retour);
vst_color( handle, 2);
v_ftext( handle, 120, 120, txt );
vst_unload_fonts( handle,0);
v_clsvwk(handle);
open_work();
vst_load_fonts( handle, 0);
vswr_mode ( handle, MD_REPLACE);
pxyarray[0]=0;
pxyarray[1]=0;
pxyarray[2]=largeur_vdi;
pxyarray[3]=hauteur_vdi;
vs_clip(handle, -1 ,pxyarray);
pxyarray[0]=0;
pxyarray[1]=0;
pxyarray[2]=largeur_vdi-1;
pxyarray[3]=hauteur_vdi-1;
/* vsf_color(handle,0);
v_bar(handle,pxyarray);
*/
for (i=0;i<nb_couleur_vdi;i++)
{
vq_color(handle,i,0,rgb2[0]);
vs_color(handle,i,rgb[i]);
vq_color(handle,i,0,rgb2[1]);
printf("Work_out(4) : %d\n", work_out[4]);
printf("couleur %d: compo r:%4d g:%4d b:%4d\n",i,
rgb2[1][0],
rgb2[1][1],
rgb2[1][2]);
pxyarray[0]=(TAILLE * i)+100;
pxyarray[1]=100;
pxyarray[2]=pxyarray[0]+50;
pxyarray[3]=200;
vsf_color(handle,i);
v_rfbox(handle,pxyarray);
}
/*
v_bit_image( handle, filename, aspect, x_scale, y_scale,
h_align, v_align,pxyarray );
}
*/
id = vqt_name( handle, 2, &txt);
printf("%s\n", txt);
vst_font( handle, id);
/* vst_arbpt32( handle,12,&dummy,&dummy,&dummy,&retour);*/
vst_point( handle,12,&dummy,&dummy,&dummy,&retour);
printf("%d\n",retour);
vst_color( handle, 2);
v_gtext( handle, 400, 400, txt );
/*
vst_alignment(handle,0,0,&dummy,&dummy);
vst_arbpt( handle,12,&dummy,&dummy,&dummy,&retour);
vst_point( handle,12,&dummy,&dummy,&dummy,&retour);
vst_color( handle, 2);
v_justified( handle, 150,200,txt,250,1,0);
v_ftext( handle, 200, 200, txt );
*/
v_updwk(handle);
v_clrwk(handle);
vst_unload_fonts( handle,0);
v_clswk(handle);
}