Ok, I've been busy on vector stuff. Not with this, but Cairo. I couldn't manage to get a Blitz program to incorporate the C source, but using a DLL I've got a Cairo context rendering straight onto a pixmap buffer with full alpha, gradients etc. I've made near-complete wrapper types so the Blitz code with the module I'm making looks like this:
canvas:TPixmap = CreatePixmap(256,256,PF_BGRA8888)
surf:TCairoSurface = TCairoImageSurface.CreateForPixmap(canvas)
cairo:TCairo = TCairo.Create(surf)
cairo.SetSourceRGBA(1,0.2,0.2,0.6)
cairo.Arc(xc, yc, 0.05, 0, 2*Pi)
cairo.Fill()
cairo.SetLineWidth(0.03)
cairo.Arc(xc, yc, radius, angle1, angle1)
cairo.LineTo(xc, yc)
cairo.Arc(xc, yc, radius, angle2, angle2)
cairo.LineTo(xc, yc)
cairo.Stroke()
rather than
canvas:TPixmap = CreatePixmap(256,256,PF_BGRA8888)
surf:Byte Ptr = cairo_image_surface_create_for_data( PixmapPixelPtr(canvas), ..
CAIRO_FORMAT_ARGB32, PixmapWidth(canvas), PixmapHeight(canvas), ..
PixmapPitch(canvas) )
cairo:Byte Ptr = cairo_create(surf)
cairo_set_source_rgba(cairo, 1,0.2,0.2,0.6)
cairo_arc(cairo, xc, yc, 0.05, 0, 2*Pi)
cairo_fill(cairo)
cairo_set_line_width(cairo, 0.03)
cairo_arc(cairo, xc, yc, radius, angle1, angle1)
cairo_line_to(cairo, xc, yc)
cairo_arc(cairo, xc, yc, radius, angle2, angle2)
cairo_line_to(cairo, xc, yc)
cairo_stroke(cairo)
As yet you can only do stuff manually, I haven't managed to find a way for it to interpret any kind of vector format (there's a libsvg-cairo but I can't work out how to incorporate it).
|