The class Cairo of the component Cairo (gb.cairo) is used for drawing on an image (data type Image) or a surface (Surface).
Example:
Private Sub GeneratePDF() Dim sPfadBildDatei As String Dim imgImage As Image Dim PDFSurface As CairoPdfSurface sPfadBildDatei = Application.Path &/ "fractal.png" imgImage = Image.Load(sPfadBildDatei) PDFSurface = New CairoPdfSurface(sPfadPDFDatei, 210, 297) ' -->> DIN A4 surface Cairo.Begin(PDFSurface) Cairo.Matrix.Translate(MMToPoints(20), MMToPoints(20)) Cairo.Matrix.Scale(1, 1) '-- Zoom-Factor = 1 Cairo.Arc(MMToPoints(80), MMToPoints(75), MMToPoints(70)) '-- Circle Cairo.Clip() '-- Clip-Method If Exist(sPfadBildDatei) Then Cairo.Source = Cairo.ImagePattern(imgImage, 0, 0) Cairo.Paint() Endif Cairo.End PDFSurface.Finish() Desktop.Open(sPfadPDFDatei) End
Figure 25.1.1.1: Circular clip area with underlaid image