[cairo] Hello, Cairo! Re: Simple Win32 GDI example with Cairo wanted
lurker0ster at gmail.com
Wed Sep 3 04:31:18 PDT 2008
Hi folks, I setup VS2008 Cairo hello world project without using GTK+
Actually Cairo has win32 surface support(base on GDI). Use
instead of other surface creating API (like cairo_image_surface_create).
Only few instructions need to be follow:
0. Download cairo lib for windows.
1. Use wizard to create a win32 project in Visual C++ 2008 express.
2. Open <your project name>.cpp and find function WndProc.
3. Modify WM_PAINT branch with piece of code below:
hdc = BeginPaint(hWnd, &ps);
// TODO: Add any drawing code here...
surface = cairo_win32_surface_create(hdc);
cr = cairo_create(surface);
Draw(cr); // <<<<<<Cairo draw here
4. Add cairo lib path to new project.
5.Compile and check the result
After that, you will see your cairo drawing in Windows program's client
Hope it is helpful, and correct me if there are mistakes.
2008/9/2 Mohit Sindhwani <tech at onghu.com>
> Asko Kauppi wrote:
> > I would second this.
> > Although setting up a "Hello world" IDE project drawing the text using
> > Cairo should not be a Big Deal, it certainly would help the initial
> > step (instead of pressing 'new' in the IDE).
> > Especially since Windows is my 3rd platform, and I am using VC++ 2008
> > Express only occasionally. So, if anyone has a "Hello world" Cairo +
> > VC++ 2008 project to spare, thanks! :)
> > In fact, I would like to see such Hello World for VC++, GTK+ and OS X
> > (XCode) all of them.
> > -asko
> Actually I have a Hello World example for Borland Turbo C++ (the new
> currently free version of C++ Builder) - I'm a bit busy the next few
> days, but should be able to post more information about it in the weekend.
> 9/2/2008 | 12:24 AM.
> cairo mailing list
> cairo at cairographics.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cairo