FWIW, here's Code which renders a "seamless RainBow-Pattern" with the help of the VB6-CairoWrapper (available on vbRichClient.com):
HTHCode:Option Explicit Private Sub Form_Resize() RenderToFormOrPicBox Me, Array(vbRed, vbYellow, vbGreen, vbCyan, vbBlue, vbMagenta, vbRed) End Sub Private Sub RenderToFormOrPicBox(Canvas, ColorStops) Canvas.ScaleMode = vbPixels Dim CC As cCairoContext, Pat As cCairoPattern, i As Long Set CC = Cairo.CreateSurface(Canvas.ScaleWidth, Canvas.ScaleHeight).CreateContext Set Pat = Cairo.CreateLinearPattern(0, 0, CC.Surface.Width, 0) For i = 0 To UBound(ColorStops) 'add the Color-Stops for this gradient-pattern Pat.AddColorStop i / UBound(ColorStops), ColorStops(i) Next CC.Paint 1, Pat 'now render the gradient-pattern via the CairoContext Set Canvas.Picture = CC.Surface.Picture End Sub
Olaf




Reply With Quote