eric’s extremeboredom

adventures into and out of extreme boredom.

Transparent drawing using C#, Cairo and Xgl

Yesterday I updated my computer to Dapper Drake (which is what will become the next version of ubuntu) so I could try out Xgl. It is honestly the coolest thing I have ever seen linux do, and will only continue to get better. If you’re brave enough to use an unstable operating system, I highly recomend trying it out (directions here).

It is important to note that Xgl provides more than just wobbly windows and a cube reperesenting your virtual desktops, but it also gives you an additional color channel that you can use when drawing to the screen – the alpha channel. This makes it possible to create (semi-)transparent windows as well as arbitrarily-shaped windows that have a smooth border just like on OSX and Windows.

Here is a C# example of how to create an ARGB drawing using Cairo:

(Click for code)

Hopefully I’ll have time this week to put a sexier example together.


Categorized as Open Source, Mono, Open Source, Technology, Software Development, Technology

1 Comments

  1. Ok, for those of us interested in this right now, how about you put a link to the code ?

    Also, do you think it is easy enough to pull in SVG directly from inkscape ?

Leave a Reply