* stippling on color vs2000
[not found] <473@zgdvda.UUCP>
@ 1989-04-14 21:58 ` Brian V. Smith
0 siblings, 0 replies; only message in thread
From: Brian V. Smith @ 1989-04-14 21:58 UTC (permalink / raw)
I am trying use a stipple on a window in X11R3.
On our monochrome vs2000 this works fine. But on our 4-plane color
vs2000 the color that is used (and the pattern) is seemingly random!
Here is the section of code that creates the gc:
init_fill_gc()
{
XGCValues gcv;
int i;
gcv.fill_style = FillStippled;
for (i=0; i<NUMFILLPATS; i++)
{
fill_pm[i] = XCreateBitmapFromData(tool_d, XtWindow(canvas_sw),
fill_images[i],8,8);
fill_gc[i] = makegc(PAINT, x_fg_color.pixel, x_bg_color.pixel);
gcv.stipple = fill_pm[i];
XChangeGC(tool_d, fill_gc[i], GCStipple|GCFillStyle|GCArcMode,
&gcv);
}
}
GC
makegc(op, fg, bg)
int op;
Pixel fg;
Pixel bg;
{
register GC ngc;
XGCValues gcv;
int gcmask;
gcv.font = roman_font->fid;
gcv.join_style = JoinMiter;
gcmask = GCJoinStyle|GCFunction|GCForeground|GCBackground|GCFont;
switch (op) {
case PAINT:
gcv.foreground = fg;
gcv.background = bg;
gcv.function = GXcopy;
break;
case ERASE:
gcv.foreground = bg;
gcv.background = bg;
gcv.function = GXcopy;
break;
case INV_PAINT:
gcv.foreground = fg ^ bg;
gcv.background = bg;
gcv.function = GXxor;
break;
case MERGE:
gcv.foreground = fg;
gcv.background = bg;
gcv.function = GXor;
break;
}
ngc = XCreateGC(tool_d, XtWindow(canvas_sw), gcmask, &gcv);
XCopyGC(tool_d, gc, ~(gcmask), ngc); /* add main gc's values not
specified here to the new one */
return (ngc);
}
Here is the code that does the fill:
gc = fill_gc[i]; /* where i is the fill pattern index */
XFillPolygon(tool_d,canvas_pixwin,gc,points, npts,
Complex, CoordModeOrigin);
Again, this works in monochrome, but not in color.
Note that I have explicitely set the color for foreground
(and background) in the gc, but the colors on the screen are random.
I have checked the actual values in the gc with dbx and they are ok.
Is this a bug in the server implementation for the color vs2000?
_____________________________________
Brian V. Smith (bvsmith@lbl.gov)
Lawrence Berkeley Laboratory
We don't need no stinking signatures!
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1989-04-14 21:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <473@zgdvda.UUCP>
1989-04-14 21:58 ` stippling on color vs2000 Brian V. Smith
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox