[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [XForms] Is there some way of putting a semi transparent box on an x

From: Jens Thoms Toerring
Subject: Re: [XForms] Is there some way of putting a semi transparent box on an xyplot?
Date: Wed, 1 May 2013 18:54:21 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Bill,

On Tue, Apr 30, 2013 at 08:48:05AM -0700, Bill Unruh wrote:
> xforms does support some "transparency" in supporting xor drawing.
> fl_drawmode(GXxor);

I hadn't considered that this could be considered "transparency",
I had thought along alpha-channels etc. fl_drawmode() is just a
very thin layer over the wrapped Xlib functionality (it just
calls XSetFunction()). And, of course, you're free to use that
and raw Xlib calls as well when you're working with a canvas.
And there you can also use all newer X extensions (e.g. for
real transparency) when you're prepared to work at that level.

>  and
> the Positioner in xor mode (agreed not quite the same as transparency but
> probably just as good for me.)
> I am not sure what xor does-- are the bits in each of the colors actually 
> being
> xored against the bits in the overlying color? But xor against black gives 
> black,
> and since all bits
> of black are 0, that does not really make sense. (or is black
> encoded as all 1s?)

Had to check my Xlib reference manual;-) And, as far as I under-
stand it, it really just xors the bits of background and what you
try to draw on top of it. If the background is black then you get
exactly what you try to draw on it (so nothing which looks like
transparency) and when the backgroung is pure white everything
you will get is again pure white whatever you draw on top of it.
And when the foreground is black you get just the backgroun etc.
So it's not really useful for doing transparency:-(

As far as I understand transparency tyically involves doing some
kind of weighted averaging of the color values of background and
foreground (and there seem to be several ways to do it). But I
never have done that for real, it's just from a bit of googling
and reading a bit in Wikipedia;-)

> I thought of using the GXxor in an overlay with the linewidth cranked way up
> to do a "fill" but plotting on an overlay also redraws the axes of the
> underlying xyplot, which makes a complete mess. (Was that how the problem of
> the overlay positioner leaving ghosts behind solved-- redraw everthing in the
> xyplot every time any overlay layer changes?)

If it was me that did that I don't remember, but it doesn't sound
too improbable...

> On another question, how do I adjust the lines on the overlay positioner to
> not extend to the edges of the positioner form? I tried setting bounds, but
> that seemed to do nothing.

If you're talking about the positioner object then the lines should
stop about a pixel shy of the edges. If they don't there's some bug!
But perhaps I misunderstand you here...

                              Best regards, Jens
  \   Jens Thoms Toerring  ________      address@hidden
   \_______________________________      http://toerring.de

reply via email to

[Prev in Thread] Current Thread [Next in Thread]