Python and Core Graphics
Python and Core Graphics
- Subject: Python and Core Graphics
- From: Greg Hulands <email@hidden>
- Date: Fri, 4 Jun 2004 10:41:50 +1000
Hi,
I am writing an image renderer in python using the CG library. I am
compositing an image into 2 different areas on the bitmap context so I
am calling clipToRect so that the image won't flow out past the bounds
of the specified rect. The first image is drawn correctly, but the
second image does not get drawn at all. In the API Summary file it says
the the clip path is reset so that the rect is the only path in the
clipping path. I am thinking that this may not be the case. Has anyone
else used the clipToRect function with success?
Here is the code:
def compositeLayout(self, filename):
self._setupGraphics()
self._setupRenderer()
self._renderedCtx.setInterpolationQuality(self._quality)
for i in range(0, len(self._configuration["images"])):
daBox = self.transformBox(self._configuration["images"][i])
self._renderedCtx.clipToRect(daBox)
self._renderedCtx.drawImage(self.imageBoxForImageBounds(self._image,
daBox), self._image) # this just returns a centered image rect for the
bounds.
any help is greatly appreciated.
Thanks,
Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.