Re: Scribble Example



Thank you very much for your effort, guys!
I've finally got it to work. Ok, it might not be 100% perfect.

To remove the "old" rectangles while moving the mouse I just draw the
rectangle again. This is working because i am using $gc->set_function
('xor') and Gtk2::Gdk::Color->new (65535, 65535, 65535). The drawn
rectangle has now the opposite color of the pixel below. When you redraw
it the color is original color again ;-)

See the attached file...

Cheers,
Mario

Am Dienstag, den 05.08.2008, 08:16 -0400 schrieb zentara:
On Tue, 05 Aug 2008 10:06:45 +1000
Kevin Ryde <user42 zip com au> wrote:

zentara <zentara1 sbcglobal net> writes:

I chopped down your model to the point where it would draw a simple
rectangle, without the mouse drag. Then I added a line at a time back in,
until it stopped working.

The culprit is:

$gc->set_function ('xor');

Yes and no, I suspect there's no pixel values set into the gc.  The RGB
parts of a GdkColor have no effect at the gc->set_foreground level ...

I also tried with the dragging rectangles and trying to use clear_area on each draw, 
to clear all the interior rectangles. But it seemed you need to adjust corners by + or - 1 pixel
to compute the area to be cleared, and it didn't work right. 
But it may be possible to perfect.

Attachment: screeny.pl
Description: Perl program



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