当前位置: 首页>>代码示例>>Python>>正文


Python image.Image方法代码示例

本文整理汇总了Python中kivy.uix.image.Image方法的典型用法代码示例。如果您正苦于以下问题:Python image.Image方法的具体用法?Python image.Image怎么用?Python image.Image使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在kivy.uix.image的用法示例。


在下文中一共展示了image.Image方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: update_test_image

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def update_test_image(self, *_):
        """Regenerate the watermark preview image."""

        if self.watermark_settings:
            test_image = self.watermark_settings.ids['testImage']
            test_image.clear_widgets()
            if os.path.isfile(self.watermark_image):
                image = KivyImage(source=self.watermark_image)
                size_x = test_image.size[0]*(self.watermark_size/100)
                size_y = test_image.size[1]*(self.watermark_size/100)
                image.size = (size_x, size_y)
                image.size_hint = (None, None)
                image.opacity = self.watermark_opacity/100
                x_pos = test_image.pos[0]+((test_image.size[0] - size_x)*(self.watermark_horizontal/100))
                y_pos = test_image.pos[1]+((test_image.size[1] - size_y)*(self.watermark_vertical/100))
                image.pos = (x_pos, y_pos)
                test_image.add_widget(image) 
开发者ID:snuq,项目名称:Snu-Photo-Manager,代码行数:19,代码来源:screenexporting.py

示例2: redisplay

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def redisplay(self, root):
    if self.result.code == preview_thread.COMPLETE:
      root.cols = self.result.columnCount
      while len(root.children) > len(self.result.data):
        root.remove_widget(root.children[-1])
      while len(root.children) < len(self.result.data):
        root.add_widget(Image())
      for i in xrange(0, len(self.result.data)):
        current = root.children[i]
        if len(self.textures) <= i:
          self.textures.append(Texture.create_from_data(self.result.data[i]))
          self.textures[i].flip_vertical()
        else:
          self.textures[i].blit_data(self.result.data[i])
        current.texture = None
        current.texture = self.textures[i]
        current.size_hint = (1.0*self.result.sizes[i][0]/self.result.width,
                             1.0*self.result.sizes[i][1]/self.result.height)
      root.width = root.height * self.result.width / self.result.height
      #root.height = root.width * self.result.height / self.result.width
    else:
      root.clear_widgets() 
开发者ID:Tenrec-Builders,项目名称:pi-scan,代码行数:24,代码来源:preview.py

示例3: __init__

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def __init__(self, settings, dashboard_factory, **kwargs):
        super(DashboardScreenPreferences, self).__init__(**kwargs)
        self._settings = settings

        current_screens = self._settings.userPrefs.get_dashboard_screens()
        screen_keys = dashboard_factory.available_dashboards
        for key in screen_keys:
            [name, image] = dashboard_factory.get_dashboard_preview_image_path(key)
            checkbox = CheckBox()
            checkbox.active = True if key in current_screens else False
            checkbox.bind(active=lambda i, v, k=key:self._screen_selected(k, v))
            screen_item = DashboardScreenItem()
            screen_item.add_widget(checkbox)
            screen_item.add_widget(FieldLabel(text=name))
            screen_item.add_widget(Image(source=image))
            self.ids.grid.add_widget(screen_item)
        self._current_screens = current_screens 
开发者ID:autosportlabs,项目名称:RaceCapture_App,代码行数:19,代码来源:dashboardview.py

示例4: loading

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def loading(self, ll=1):
        self.valid = False
        self.li = Image(source='img/image-loading.gif')
        self.add_widget(self.li)
        self.ids.surface.canvas.remove(self.canv)
        threading.Thread(target=self._load_file, args=(ll,)).start() 
开发者ID:wolfmanjm,项目名称:kivy-smoothie-host,代码行数:8,代码来源:viewer.py

示例5: on_touch_up

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def on_touch_up(self, touch):
        ret = False
        for e in self.children:
            if not isinstance(e, Image):
                if e.collide_point(touch.x, touch.y):
                    ret = e.on_touch_up(touch)
                    break
        return ret 
开发者ID:kpiorno,项目名称:kivy3dgui,代码行数:10,代码来源:layout3d.py

示例6: __init__

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def __init__(self, **kwargs):
        wpos = self.pos = kwargs.pop("pos")
        try:
            self.create_image = kwargs.pop("create_image")
            super(Note, self).__init__(**kwargs)
        except:
            print(kwargs)         
        self.opacity = 0
        #Show
        anim = Animation(opacity=1.0, duration=0.3)
        anim.start(self)        
        create_image = kwargs.get('create_image', False)
                
        self.request_del = False
        text_editor = TextInput(size = (120, 90))
        close = Button(size = (20, 20), text="x")
        image = Image(source="./data/imgs/background.jpg", allow_stretch=True, keep_ratio=False)

        self.add_widget(image)
        self.add_widget(text_editor)
        self.add_widget(close)
        
        if create_image:         
            image_front = Image(source="./data/imgs/faust_github.jpg", size=(120,70), allow_stretch=True, keep_ratio=False)
            self.add_widget(image_front)

        self.size = (120, 120)
        self.size_hint = (None, None)
        image.size = (120, 120)
        text_editor.pos = (0, 10)
        close.pos = (100, 100)
        self.pos = wpos

        close.bind(on_release=self.close_request) 
开发者ID:kpiorno,项目名称:kivy3dgui,代码行数:36,代码来源:tour3d.py

示例7: _load_fullsize

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def _load_fullsize(self):
        app = App.get_running_app()
        if not self.lowmem:
            low_memory = to_bool(app.config.get("Settings", "lowmem"))
        else:
            low_memory = True
        if not low_memory:
            #load a screen-sized image instead of full-sized to save memory
            if os.path.splitext(self.source)[1].lower() == '.bmp':
                #default image loader messes up bmp files, use pil instead
                self._coreimage = ImageLoaderPIL(self.source)
            else:
                self._coreimage = KivyImage(source=self.source)
        else:
            #load and rescale image
            original_image = Image.open(self.source)
            image = original_image.copy()
            original_image.close()
            resize_width = Window.size[0]
            if image.size[0] > resize_width:
                width = int(resize_width)
                height = int(resize_width * (image.size[1] / image.size[0]))
                if width < 10:
                    width = 10
                if height < 10:
                    height = 10
                image = image.resize((width, height))
            if image.mode != 'RGB':
                image = image.convert('RGB')
            image_bytes = BytesIO()
            image.save(image_bytes, 'jpeg')
            image_bytes.seek(0)
            self._coreimage = CoreImage(image_bytes, ext='jpg')

        self.texture = self._coreimage.texture
        if self.mirror:
            self.texture.flip_horizontal() 
开发者ID:snuq,项目名称:Snu-Photo-Manager,代码行数:39,代码来源:generalelements.py

示例8: __init__

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def __init__(self, **kwargs):
        self._prev_arrow_pos = None
        self._arrow_layout = BoxLayout()
        self._bk_img = Image(
            source=self.background_image, allow_stretch=True,
            keep_ratio=False, color=self.background_color)
        self.background_texture = self._bk_img.texture
        self._arrow_img = Image(source=self.arrow_image,
                                allow_stretch=True,
                                color=self.background_color)
        self.content = content = BubbleContent(parent=self)
        super(Bubble, self).__init__(**kwargs)
        content.parent = None
        self.add_widget(content)
        self.on_arrow_pos() 
开发者ID:BillBillBillBill,项目名称:Tickeys-linux,代码行数:17,代码来源:bubble.py

示例9: new_game

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def new_game(self):
        if use_ads:
            revmob.show_popup()
        self.content.clear_widgets()
        self.content.add_widget(Image(source='assets/graphics/ui/loading.png', size=Window.size, allow_stretch=True))
        Clock.schedule_once(self.post_splash) 
开发者ID:oddbitdev,项目名称:hexTap,代码行数:8,代码来源:main.py

示例10: show_enemy_turn_splash

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def show_enemy_turn_splash(self):
        self.enemy_turn_splash = Image(source='assets/graphics/ui/enemyTurn.png', size_hint=(1, 1), pos_hint={'x': 0, 'y': 0})
        self.add_widget(self.enemy_turn_splash) 
开发者ID:oddbitdev,项目名称:hexTap,代码行数:5,代码来源:MapCanvas.py

示例11: show_too_far_splash

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def show_too_far_splash(self):
        self.tile_too_far_splash = Image(source='assets/graphics/ui/tileTooFar.png', size_hint=(1, 1), pos_hint={'x': 0, 'y': 0})
        self.add_widget(self.tile_too_far_splash) 
开发者ID:oddbitdev,项目名称:hexTap,代码行数:5,代码来源:MapCanvas.py

示例12: add_portal

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def add_portal(self):
        self.portal = Image(source='assets/graphics/tiles/portal.png', pos=(self.x + 10, self.y + 264))
        self.add_widget(self.portal) 
开发者ID:oddbitdev,项目名称:hexTap,代码行数:5,代码来源:HexTile.py

示例13: add_key

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def add_key(self):
        self.key = Image(source='assets/graphics/tiles/' + self.key_type + '.png', pos=(self.x + 20, self.y + 274))
        self.add_widget(self.key) 
开发者ID:oddbitdev,项目名称:hexTap,代码行数:5,代码来源:HexTile.py

示例14: add_star

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def add_star(self):
        self.star = Image(source='assets/graphics/tiles/starGold.png', pos=(self.x + STAR_POS[0],
                                                                            self.y + STAR_POS[1] + 204))
        self.add_widget(self.star) 
开发者ID:oddbitdev,项目名称:hexTap,代码行数:6,代码来源:HexTile.py

示例15: add_mod_layer

# 需要导入模块: from kivy.uix import image [as 别名]
# 或者: from kivy.uix.image import Image [as 别名]
def add_mod_layer(self):
        mod_type = choice(mod_layers)
        self.mod_layer = Image(source='assets/graphics/tiles/' + mod_type + '.png',
                               pos=(self.x, self.y + 204), size=(120, 210))
        self.add_widget(self.mod_layer) 
开发者ID:oddbitdev,项目名称:hexTap,代码行数:7,代码来源:HexTile.py


注:本文中的kivy.uix.image.Image方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。