www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/06/28/10:16:44

From: GianPiero Puccioni <gip AT firefox DOT ino DOT it>
Subject: some questions about GRX
To: djgpp AT sun DOT soe DOT clarkson DOT edu (DJGPP List)
Date: Tue, 28 Jun 94 16:04:41 LEG
Mailer: Elm [revision: 66.25]

Hi all,


       I am a newcomer to djgpp (I installed it only 4 days ago), And of
course I have  all  sort  of  problems,  mostly  with the GRX103 graphic
libray. If you know where I can find a FAQ or a more detailed manual  or
even  some  examples  ( with a comment line thrown in here and there...)
just point me in that direction.

If there isn't such a thing I'd like a little help on some of  the  more
pressing questions namely on the Palette and PatternFilledBox functions.

How do I set up a palette  the  way I want (assume I use 800x600x256)? I
am used to Workstation graphic where you just fill up an array with  256
RGB components and call a function to set the palette. The way GRX works
is  new  for  me. If I understand it well you have first to allocate the
cell and get a number for it THEN give it the values you want with Black
and White always defined ( I  tried  to  Free them but it didn't work) I
used this to set up a Grey Palette and  the  col  array  to  use  in  the
BuildPixmap function afterwards:

col[0]=256;
for (i=1;i<255;i++)
{   j=GrAllocCell();
    GrSetColor(j,i,i,i);
    col[i+1]=j;
}
col[1]=GrBlack();
col[256]=GrWhite();

This works, but is  there  another  way  of  doing it? Getting the colors
in order, maybe (using this pure White is 15  instead  of being 255). And
what about if I don't want White and/or Black in it. 

Second problem: I wanted to put on the screen an image I generated in an
array of Unsigned char (intens[SIZE*SIZE]) with that palette. I used this:

p=GrBuildPixmap(intens,SIZE,SIZE,col);
GrPatternFilledBox(100,100,100+SIZE-1,100+SIZE-1,p);
GrDestroyPattern(p);

but instead of placing my  image  on  the screen it displayed a somewhat
shifted version of it. Sort of the same way if it were a window cut in a
floor tiled with my pattern. The image apper only  if  the  displacement
instead  of  being  100 is 0 ( or a multiple of SIZE). Is there a way of
putting an image anywhere on the screen?


As I am here: Do you know  if  (and where) I can find an already written
function to dump the screen ( or part of it) on a printer  (  Postscript
or PCL5)? I'll avoid writing it myself, or going through a PCX image and
an external program to print it.

Sorry for the long message.


Ciao,

            GianPiero

--
****************************************************************************
*  Istituto Nazionale di Ottica                        GianPiero Puccioni  *
*  Largo E.Fermi 6                           E-Mail :  gip AT firefox DOT ino DOT it  *
*  I-50125  Firenze - ITALY             c=it;a=garr;p=ino;o=firefox;s=gip  *
*  Tel +39 55 23081  -  Fax +39 55 2337755                                 *
****************************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019