Created
August 8, 2015 13:37
-
-
Save stuaxo/453e460797096c37bb41 to your computer and use it in GitHub Desktop.
Draw a yellow rectangle in cairocffi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # coding: utf-8 | |
| # In[12]: | |
| # draw a yellow rectangle with cairocffi | |
| import cairocffi as cairo | |
| im = cairo.ImageSurface(cairo.FORMAT_ARGB32, 512, 512) | |
| ctx = cairo.Context(im) | |
| ctx.set_source_rgb (1., 1., 0.) | |
| ctx.rectangle(0, 0, 256,256) | |
| ctx.fill() | |
| im.write_to_png("yellow-rectangle.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment