Re: Anti-Aliased 2D drawing



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Scott Robert Ladd <gnome coyotegulch com> writes:

> Roger Leigh wrote:
>> Have you taken a look at libgnomecanvas?  Despite the name, it only
>> depends on GTK+, and it allows anti-aliased line drawings of arbitrary
>> size.
>> 
>> I don't know, but I suspect it will be replaced by, or depend upon,
>> Cairo at some point, but it's mature and usable right now.
>
> My only problem is in finding a reasonable tutorial for GnomeCanvas. If
> you know of one, I'd appreciate a pointer to it.
>
> I'm just drawing lins on top of an existing pixbuf; nothing terribly
> complex. I think I'm doing everything right, but the line doesn't show
> up. A quick tutorial will probably show me the obvious.

I don't have a tutorial I'm afraid, but you're welcome to look at my
code (and use it--it's GPL :-).

http://arch.debian.org/cgi-bin/archzoom.cgi/rleigh debian org--2005-uterm/uterm--mainline--0.1--patch-41/cse?color=default

The cse-canvas-*.[ch] files will be the ones of interest.  The base
GnomeCanvas objects are found in cse-canvas.[ch].
cse_canvas_realize() and cse_canvas_init() are where the interesting
canvas-y stuff happens.

The other files are derived GnomeCanvasItems.  You don't need to
derive GnomeCanvasItems at all--using the stock items is fine, but
I've used it to simplify canvas operations by deriving from
GnomeCanvasGroup, so a single object can contain a set of related
items which may be manipulated as a whole.

Sorry about the lack of documentation there--I've not yet documented
the canvas stuff.


You can check out the whole source tree using the instructions here:

http://arch.debian.org/cgi-bin/archzoom.cgi/rleigh debian org--2005-uterm/uterm--mainline--0.1--patch-41/README?color=default

If you don't have arch or the build dependencies, I can put up a
tarball.  Seeing how the canvas stuff looks on screen will hopefully
illustrate better what the code is doing.  (You'll need to configure
with CC='gcc -std=gnu99' until autoconf includes AC_PROG_CC_C99.)


I found the Gnumeric sources, and the advice of Jody Goldberg (the
maintainer) to be invaluable while writing this.


Regards,
Roger

- -- 
Roger Leigh
                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                Debian GNU/Linux        http://www.debian.org/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFCiQISVcFcaSW/uEgRAo5zAKCmRjcRbcRMhe0ffV69G7loZOqRGgCfTOHP
KfEcyMXCQtdKMn54oVkD4mI=
=1SaL
-----END PGP SIGNATURE-----



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