[cairo] Correct bitmap size and offset calculation based of pen width and scale

Prashant Saxena animator333 at yahoo.com
Fri Sep 17 03:02:45 PDT 2010


Hi,

In this simple script I am trying to render an offline image and save it as 
bitmap.
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?

Cheers

Prashant


-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.py
Type: application/octet-stream
Size: 1623 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100917/4677fcd3/attachment.obj>


More information about the cairo mailing list