Article View: ba.windows.x
Article #129Full color X
From: Ken Fishkin
Date: Thu, 16 Jan 1992 01:40
Date: Thu, 16 Jan 1992 01:40
37 lines
1896 bytes
1896 bytes
hello,
As a total X tyro, I'm trying to open a 24-bit X window on
our SPARC with a GS board. I know this *can* be done, as "xv",
"xloadimage", and so forth all display 24 bit images using X.
I try this, a modified version of the code in xloadimage:
XVisualInfo vinfo;
display = XOpenDisplay(NULL);
scrn = DefaultScreen(display);
if (XMatchVisualInfo(display,scrn,24,TrueColor,&vinfo) == 0)
fprintf(stderr,"vinfo botch.\n");
swa_img.save_under = 0;
swa_img.border_pixel = 0;
window = XCreateWindow(
display,
RootWindow(display,scrn), /* parent */
0, 0, 256, 256, 0, /* offset, size, border */
24, /* depth */
InputOutput, /* class */
vinfo.visual, /* visual */
CWSaveUInder | CWBorderPixel,
&swa_imag);
This barfs with "BadMatch", minor opcode 0.
xdpyinfo says that yes indeed, it has a 24 class visual,
which is indeed found by XMatchVisualInfo. If I change the "24" to "8",
and use "CopyFromParent" for the visual, then it works, so I think
the other parameters are OK.
any help greatly appreciated,
-Ken
--
Ken Fishkin fishkin@xerox.com
Technical Details
Message-ID:
<1992Jan16.014025.5836@parc.xerox.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!ukma!wupost!usc!elroy.jpl.nasa.gov!ames!bionet!parc!fishkinShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103734,f2ac18641918ca90,start X-Google-Attributes: gid103734,public X-Google-Thread: 10e286,f2ac18641918ca90,start X-Google-Attributes: gid10e286,public X-Google-Thread: 159e5d,f2ac18641918ca90,start X-Google-Attributes: gid159e5d,public X-Google-ArrivalTime: 1992-01-16 09:03:04 PST Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!wupost!usc!elroy.jpl.nasa.gov!ames!bionet!parc!fishkin From: fishkin@parc.xerox.com (Ken Fishkin) Newsgroups: ba.windows.x,comp.windows.x,parc.sunusers Subject: Full color X Message-ID: <1992Jan16.014025.5836@parc.xerox.com> Date: 16 Jan 92 01:40:25 GMT Sender: news@parc.xerox.com Organization: Xerox Palo Alto Research Center Lines: 37 Originator: fishkin@pan