Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

format_stride_for_width example in API docs doesn't work #50

Closed
stuaxo opened this issue Feb 19, 2015 · 1 comment
Closed

format_stride_for_width example in API docs doesn't work #50

stuaxo opened this issue Feb 19, 2015 · 1 comment

Comments

@stuaxo
Copy link

stuaxo commented Feb 19, 2015

The example on this page https://pythonhosted.org/cairocffi/api.html causes an exception:

from cairocffi import ImageSurface
stride = ImageSurface.stride_for_width(format, width)
data = bytearray(stride * height)
surface = ImageSurface(format, width, height, data, stride)

## -- End pasted text --
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-e39a39a18953> in <module>()
      1 from cairocffi import ImageSurface
----> 2 stride = ImageSurface.stride_for_width(format, width)
      3 data = bytearray(stride * height)
      4 surface = ImageSurface(format, width, height, data, stride)

AttributeError: type object 'ImageSurface' has no attribute 'stride_for_width'

@SimonSapin
Copy link
Member

Good catch, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants