-
Dec 25th, 2018, 05:26 PM
#1
[VB6] Tutorial: Vector- and PixelGraphics using Cairo
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 World
- 2 Scaling and simple Transforms
- 3 Lines and Stroking
- 4 Poly-Lines and BSpline-Interpolation
- 5 Bezier-Curves
- 6 Spline-Interaction
- 7 (A) Text along Curves
- 7 (B) Text along Circles
- 7 (C) FontRendering-Options
- 8 Shapes and Alpha-Opacities
- 9 Gradients
- 10 Clipping
- 11 Masking
- 12 (A) ImageSurfaces Rotate+Scale
- 12 (B) ImageSurfaces Skew+Perspective
- 12 (C) ImageSurfaces Ken Burns Effect
- 13 Alpha-JPGs
- 14 Thumbnailing per ImageList
- 15 ImageList and IconResources
- 16 SVG
- 17 PDF-Creation
- 18 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... 
Olaf
-
Apr 7th, 2021, 12:29 AM
#2
Fanatic Member
Re: [VB6] Tutorial: Vector- and PixelGraphics using Cairo
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)
Last edited by xiaoyao; Apr 7th, 2021 at 10:29 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|