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


Python Image.width方法代码示例

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


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

示例1: addImage

# 需要导入模块: from kivy.uix.image import Image [as 别名]
# 或者: from kivy.uix.image.Image import width [as 别名]
    def addImage(self, filename):
	image = Image(source=filename)
	image.size_hint = None, None
	image.width = metrics.sp(120)
	image.height = metrics.sp(120)
	self.add_widget(image)
	return
开发者ID:ik486,项目名称:kivy_examples,代码行数:9,代码来源:a16_images_fixedsize.py

示例2: build

# 需要导入模块: from kivy.uix.image import Image [as 别名]
# 或者: from kivy.uix.image.Image import width [as 别名]
 def build(self):
     self.title = "Blackjack"
     self.parent = Widget()  
     sm = ScreenManager()
     
     
     # set up the screens
     
     #splashcreen
     self.ss = Screen(name = 'splash_screen')
     splashmenu = SplashScreen()
     splashmenu.buildUp()
     self.ss.add_widget(splashmenu)
     
     #main menu
     self.mm = Screen(name = 'main_menu')
     self.mainmenu = MainMenu()
     self.mainmenu.buildUp()
     self.mm.add_widget(self.mainmenu)
     
     #add the logo to mainmenu and splashscreen
     logo = Image(source = 'images/logo.png')
     logo.width = Window.width/2
     logo.height = Window.height/2
     logo.x = Window.width/2 - (logo.width-logo.width*.05)
     logo.y = (Window.height/2 - logo.width/2)
     self.mm.add_widget(logo)
    
  
     #game screen
     
     self.gs = Game(name = 'game')
     
   
     
     #Add screens to screen manager
     sm.add_widget(self.ss)
     sm.add_widget(self.mm)
     sm.add_widget(self.gs)
     
     sm.current = 'main_menu'
     
     def check_screen_change(obj):
         if(self.mainmenu.buttonText == 'Play'):
             sm.current = 'game'
             self.gs.start_round()
             
             
     self.mainmenu.bind(on_button_release = check_screen_change)
     
     return sm
开发者ID:adam-zanol,项目名称:blackjack,代码行数:53,代码来源:main.py

示例3: __init__

# 需要导入模块: from kivy.uix.image import Image [as 别名]
# 或者: from kivy.uix.image.Image import width [as 别名]
    def __init__(self, height: int, **kwargs):
        super(TopBar, self).__init__(**kwargs)
        topBack = Image()
        topBack.color = [0, 0, 0, 1]
        topBack.width = Window.size[0]
        topBack.height = height
        self.add_widget(topBack)

        self.__grid = GridLayout()
        self.__grid.cols = 10
        self.__grid.rows = 1
        self.__grid.width = Window.size[0]
        self.__grid.height = height
        self.add_widget(self.__grid)
开发者ID:Silveryard,项目名称:SmartHome,代码行数:16,代码来源:SingleApplicationScreenWidget.py


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