• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Python and Core Graphics
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Prev by Date: Re: Is that really a bug at all? (was: Re: Ugly bug in Foundation, beware!)
  • Next by Date: Cocoa binding problem/bug - setKeys not inherited?
  • Previous by thread: Forum notify
  • Next by thread: Cocoa binding problem/bug - setKeys not inherited?
  • Index(es):
    • Date
    • Thread