Function:ss2qsd

From S2PLOT

(Difference between revisions)
Jump to: navigation, search
Revision as of 04:08, 23 November 2007
S2plot admin (Talk | contribs)

← Previous diff
Revision as of 04:09, 23 November 2007
S2plot admin (Talk | contribs)

Next diff →
Line 9: Line 9:
==Description== ==Description==
-Query the screen panel height and width in pixels.+Query the screen panel width (x) and height (y) in pixels.
== See Also == == See Also ==

Revision as of 04:09, 23 November 2007

ss2qsd

Query the screen panel dimensions.

Prototype

void ss2qsd(int *x, int *y);

Description

Query the screen panel width (x) and height (y) in pixels.

See Also

Code Example

#include <stdio.h>
#include <stdlib.h>
#include "s2plot.h"

void cb(double *t, int *kc)
{
   int x, y;                                    /* Pixel width and height */
   ss2qsd(&x, &y);                              /* Query screen dimensions */
   char string[32];
   sprintf(string,"dimensions = (%d,%d)",x,y);  /* Write to string */
   s2textxy(0,0,0,string);                      /* Display text */
}

int main(int argc, char *argv[])
{
   fprintf(stderr,"Resize window to see change in panel size");

   s2opend("/s2mono", argc, argv);              /* Open in mono mode */
   s2swin(-1.,1., -1.,1., -1.,1.);              /* Set the window coordinates */
   s2box("BCDET",0,0,"BCDET",0,0,"BCDET",0,0);  /* Draw coordinate box */

   cs2scb(cb);                                  /* Install dynamic callback */
   s2show(1);                                   /* Open the s2plot window */

   return 1;
}

Back to S2PLOT function list.


Personal tools