# VBForums UtilityBank > UtilityBank - Tutorials >  [VB6] Tutorial: Vector- and PixelGraphics using Cairo

## Schmidt

Whilst the graphics-support of the VB6-runtime (e.g. PictureBox, Shape-Controls, Line-, Circle-, Print-commands) 
is often sufficient for simpler graphics-scenarios, there are things which require the usage of "heavier guns"...
Meaning - the usage of a more capable graphic-lib with support for e.g.:
- Antialiased Drawings
- full Transparency-support using Alpha-Parameters for all Drawing-Primitives (Alpha-Colors and Alpha-Bitmaps)
- Unicode-TextOutput
- modern "Blend-Operations" for Pixel-Buffers (meaning "more than just Alpha-Blending")
- all kind of "nestable Transforms" (as e.g. Translate, Scale, Rotate)

One of those libs is the one from cairographics.org, which is platform-independent - and in use worldwide.
IMO - it's a worthwhile API to learn and invest time into - considering, that we all have to "switch from VB6 to another language" 
at some point in time... and learning a lib which has bindings for "all other languages" and not only works on Windows, might come in handy later...
*
Tutorial-Contents:*
I will not write much text here about the several "Sub-Steps in the Tutorial" -  
since all that is explained in the comments of a lot of VB6-Projects which are organized into SubFolders of the Tutorial-Zip:
(the numbered Project-Folder-Names are "increasing in difficulty, along your learning-curve-progress")

1 Hello World2 Scaling and simple Transforms3 Lines and Stroking4 Poly-Lines and BSpline-Interpolation5 Bezier-Curves6 Spline-Interaction7 (A) Text along Curves7 (B) Text along Circles7 (C) FontRendering-Options8 Shapes and Alpha-Opacities9 Gradients10 Clipping11 Masking12 (A) ImageSurfaces Rotate+Scale12 (B) ImageSurfaces Skew+Perspective12 (C) ImageSurfaces Ken Burns Effect13 Alpha-JPGs14 Thumbnailing per ImageList15 ImageList and IconResources16 SVG17 PDF-Creation18 Chipmunk-Physics (simple Balls)19 Chipmunk-Physics (Fluid)20 first simple Widgets (GUI-Controls)

The Tutorial-Zip was too large to upload (in total it's about 7MB, since the Project-Folders contain a lot of Demo-PNG-, JPG- and SVG-images) -
so I'm providing a GitHub-URL instead (which is an allowed workaround for this forum in the meantime):
https://github.com/vbRichClient/CairoTutorial

So - please download the Tutorial-Zip from the GitHub-link above...
Note, that before running the Tutorial-Projects - one has to install the COM-Class-wrapper for cairo first (vbRichClient5).

Here a ScreenShot of a Tutorial-Project, which is more related to handling of PixelGraphics via Cairo:


And two others, which show-off the Vector-graphics-support of the cairo-wrapper-classes:




Happy studying...  :Smilie: 

Olaf

----------


## xiaoyao

rc6 svg,The displayed picture is jagged, but Google Chrome does not have jagged. Is there a solution?
(Disable VBs DPI scaling and its no problem, IEs webbrowser control can also display SVG）

----------


## yereverluvinuncleber

My plan is to convert my as yet unfinished GDI+ dock to RC5 Cairo when I do finally complete the current GDI+ version and finish up my remaining tasks. I have a bit to do yet before that happens, one small thing is the conversion of the GDI+ dock to D3D (just for the experience of having done so). 

It makes sense to have a little preparation done for multi-platform graphic support assuming TwinBasic or RADBasic do get off the ground and hoping that one day there is a future for VB6 on other platforms. So, Cairo fits into that idea quite nicely and it will be the incentive I will need to dip into RC5.  

I know you think I should have been there with RC5 right from the start but my aim was building a typical Windows app. using the components that existed in the XP era alone. That is why I chose GDI+ and VB6. 

That task has been largely accomplished, the D3D conversion is the next step in the chain for me and then I can start thinking of bigger and better things, those being RC5, Cairo and VB6 and/or perhaps the conversion of my dock to VB.NET if the RADBasic/TwinBasic thing does not quite work out in the way I want them both to.

Edit - Added the latest image of my dock.

----------


## xiaoyao

HTML5 IS EASY THAN cairo

----------


## yereverluvinuncleber

> HTML5 IS EASY THAN cairo


English is easier than Chinese but I'm not sure whether either comment is relevant to this discussion.

----------

