Re: Strange behaviour / Possible Bug with GC Function
- From: Colin Thomas <colin designresources co uk>
- To: hp redhat com
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Strange behaviour / Possible Bug with GC Function
- Date: Wed, 14 Mar 2001 08:46:11 +0000 (GMT)
Hi Havoc,
A picture is worth a thousand words (as they say) so I have attached a GIF.
I am drawing four rectangles, starting at the top left and moving to the
bottom right.
The colours I am drawing in are specificaly RED-BLUE-YELLOW-GREEN, but the
last rectangle, although specified in GREEN is always drawn in BLUE.
The GDK_ORing seems to pick up the "overlapping" RED-BLUE rectangles ( I like
this), but NOT the BLUE-YELLOW or GREEN(now BLUE)-YELLOW overlaps.
As I am always drawing to the foreground, are you saying that the GDKFUNCTIONS
are not ORing the rectangle (I am adding to the foreground), with what I have
already drawn to the foreground? If this is the case, why is the RED-BLUE
overlap marked?
I hope you can see what I am trying to achieve now :-)
If we can only GDK_OR foreground to background, AFTER a rectangle has been
applied, could it be that we "copy" the foreground to the background ( and
simultaneously clear the foreground)in readiness for the next rectangle to be
applied (or something similar), to get around this??
I look forward to your thoughts..
Best regards and thanks for your reply...
Colin Thomas
X-Authentication-Warning: icon.labs.redhat.com: hp set sender to hp redhat com
using -f
To: Colin Thomas <colin designresources co uk>
Cc: gtk-app-devel-list gnome org
Subject: Re: Strange behaviour / Possible Bug with GC Function
From: Havoc Pennington <hp redhat com>
Date: 13 Mar 2001 17:05:31 -0500
User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7
MIME-Version: 1.0
Colin Thomas <colin designresources co uk> writes:
I am running with gtk+ 1.2.8 on a Solaris platform.
I have the requirement to draw to a window various shapes, and when
overlapping to show the overlaps.
I have a pixmap which I draw to a window.
I have located the GDK_FUNCTION associated with the graphics context,
i.e. GDK_COPY , GDK_AND GDK_OR etc etc .
The GDK_OR gives me the ability to see overlapping shapes, but I seem
to get some strange behaviour. For example when I draw a green rectangle
it always paints as BLUE ?? (When I remove the call seting GDK_OR, Green
appears agains, but I look the overlapping).
I don't understand what you want to happen - if you don't want green,
which is the only color you've provided explicitly, what color do you
want? Blue seems as rational as anything else, maybe you want the
function GDK_READ_MY_MIND_AND_PICK_NICE_COLOR? ;-)
Anyway, the graphics functions define how the GC foreground pixel will
be combined with the GC background pixel, on a bitwise level.
The resulting color is pretty much totally undefined. GDK_XOR will
normally produce a contrasting color, and has the property that
drawing the same thing twice "undraws" the result of the first draw,
so it's the only GdkFunction anyone ever uses. Though even GDK_XOR is
pretty useless.
Havoc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Colin Thomas.
| Email : colin designresources co uk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]