Пример #1
0
def getAppBundle():
    global _appBundle

    if _appBundle is None:
        _appBundle = Cocoa.CFBundleGetMainBundle()

    return _appBundle
Пример #2
0
    def awakeFromNib(self):
        self.openImageIOSupportedTypes = None
        # Ask CFBundle for the location of our demo image
        url = Cocoa.CFBundleCopyResourceURL(Cocoa.CFBundleGetMainBundle(),
                                            u"demo", u"png", None)
        if url is not None:
            # And if available, load it
            self.imageView.setImage_(CGImageUtils.IICreateImage(url))

        self.imageView.window().center()
        self.setRotation_(0.0)
        self.setScaleX_(1.0)
        self.setScaleY_(1.0)
        self.setTranslateX_(0.0)
        self.setTranslateY_(0.0)
        self.setPreserveAspectRatio_(False)
Пример #3
0
def doDrawImageFile(context, doclip):
    global _ourImageURL

    if _ourImageURL is None:
        mainBundle = Cocoa.CFBundleGetMainBundle()
        if mainBundle:
            _ourImageURL = Cocoa.CFBundleCopyResourceURL(
                mainBundle, kOurImageFile, None, None)

        else:
            print("Can't get the app bundle!")

    if _ourImageURL:
        if doclip:
            clipImageToEllipse(context, _ourImageURL)
        else:
            drawCGImage(context, _ourImageURL)

    else:
        print("Couldn't create the URL for our Image file!")