[cairo] Correct bitmap size and offset calculation based of pen width and scale
mikhailkozhevnikov at yandex.ru
Mon Sep 20 05:38:51 PDT 2010
cairo_stroke_extents returns the bounding box for the image based on the pen width etc. Should work fine for centering.
It doesn't seem like a good idea to calculate the offset manually.
17.09.2010, 14:02, "Prashant Saxena" <animator333 at yahoo.com>:
> In this simple script I am trying to render an offline image and save it as
> This is a test to calculate the correct size of bitmap when you have different
> pen widths (odd & even)
> and different scale.
> I think bitmap size calculation is done correctly but there is problem while
> specifying the offset before you
> draw anything on bitmap.
> The script will generate two bitmaps using wx.GraphicsContext and Cairo. In both
> the images you can see the drawing
> is not exactly in center.
> Question : How do calculate offset based on pen width and scale?
> cairo mailing list
> cairo at cairographics.org
More information about the cairo