[cairo] Cario in Visual Basic

Daniel Amelang daniel.amelang at gmail.com
Tue Dec 12 14:49:03 PST 2006


On 12/12/06, Jelmer Baas <Baas at speerit.nl> wrote:
> Hello List,
>
>
> For a CAD-like program made in Visual Basic, I'm looking for an object
> which allows me to draw lines very quickly. After reading about Cairo, I
> got interested.

That's great, it's always good to see cairo getting used in more
applications. Having said that, if you're looking for the fastest way
to draw lines in VB, cairo may not be what you're looking for. Sure,
it can draw lines quickly (and likely fast enough for your purposes),
but the focus here is on a lot more than that. And that "a lot more"
is probably going to interest you also.

> Would there be any way to use the objects in VB? I can't register the
> DLLs and can't use the LIBs, so I have no idea where to start ...
>
> If you help me get started, I will translate the include files to VB and
> post them so that Cairo can ship them, too. (Perhaps with a simple
> example?)

Out of curiousity, where did you get the cairo dll? Here?

http://www.gimp.org/~tml/gimp/win32/downloads.html

Notice that what you get from the above link isn't an ActiveX dll,
which is what VB needs to interface with cairo nicely. The cairo dll
just has plain old C functions, so you can either interface with it
like you would the Win32 API (declare each function/structure you use
etc), or you can go through the effort of creating a ActiveX DLL that
wraps cairo's functionality in nice COM objects. To do that last
approach would require quite a bit of work, but the result would be
pretty cool, and I think you'd make a number of windows developers
happy.

Now, if you downloaded the mono cairo dll (useful for VB.NET
programming) described here:

http://www.mono-project.com/Drawing

that's another story. You'll have to take it up with the mono guys on
the gtk-sharp list, as only they really know what they did.

> If anything needs to be changed in the current code of Cairo, I don't
> believe it's much work, right?

No, nothing should have to change within cairo.

Dan


More information about the cairo mailing list