Cario rendering problem
BlitzMax Forums/Brucey's Modules/Cario rendering problem
| ||
So I decided to use BaH.Cairo in a recent project of mine, and I seem to have hit a snag almost straight away. Here are some images of the problem I'm getting:![]() ![]() Basically, I have two ovals, and I am using Cairo to render them to two separate TImages, which I then draw. In each image, the second oval I render seems to have a background of white, slanted ovals. Here is all of my Cairo code: Method Create:cbRenderObject(obj:cbObject) 'Set up Cairo. Local width:Int = obj.GetWidth() Local height:Int = obj.GetHeight() Local img:TImage = CreateImage(width, height) Local cairo:TCairo = TCairo.Create(TCairoImageSurface.CreateFromImage(img)) Local matrix:TCairoMatrix = TCairoMatrix.CreateScale(width, height) Local brush:cbBrush = obj.GetBrush() cairo.SetMatrix(matrix) LockImage(img) Select obj.GetType() Case cbObject.ID_OVAL cairo.Arc(0.5, 0.5, 0.5, 0.0, 360.0) 'Shortcut for cairo.SetSourceRGBA() SetCairoCol(cairo, brush.GetFillCol()) cairo.Fill() End Select UnlockImage(img) cairo.Destroy() 'Set fields. _image = img _object = obj Return Self EndMethod This is executed for the creation of each cbRenderObject (so, twice), and then it simply draws the images using DrawImage. I'm new to Cairo, so I have no idea what the problem could be, although it's probably something quite trivial. So, can anyone (anyone probably being Brucey :D) help me out? If you want, I'll try and recreate the problem in an example. Thanks in advance. |