Outils pour utilisateurs

Outils du site


kivy_image_avec_alpha_sur_fond_blanc

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
Prochaine révisionLes deux révisions suivantes
kivy_image_avec_alpha_sur_fond_blanc [2020/01/02 12:32] – [Quel est le problème] sergekivy_image_avec_alpha_sur_fond_blanc [2020/02/08 12:17] – [Kivy: Une image avec canal alpha sur un fond blanc dans un BoxLayout] serge
Ligne 4: Ligne 4:
 **[[http://translate.google.com/translate?hl=&sl=auto&tl=en&u=https%3A%2F%2Fressources.labomedia.org%2Fkivy_image_avec_alpha_sur_fond_blanc|English Version]]** **[[http://translate.google.com/translate?hl=&sl=auto&tl=en&u=https%3A%2F%2Fressources.labomedia.org%2Fkivy_image_avec_alpha_sur_fond_blanc|English Version]]**
 </WRAP> </WRAP>
- +<WRAP center round box 40% centeralign> 
 +**[[les_pages_kivy_en_details|Les pages Kivy en détails]]** 
 +</WRAP> 
 +{{ ::kivy_fond_blanc.png?400 |}}
 ===== Arrière plan blanc sous une image avec canal alpha===== ===== Arrière plan blanc sous une image avec canal alpha=====
  
Ligne 17: Ligne 19:
 from kivy.app import App from kivy.app import App
 from kivy.uix.screenmanager import Screen from kivy.uix.screenmanager import Screen
-from kivy.uix.widget import Widget +from kivy.properties import ListProperty
-from kivy.properties import StringProperty, ListProperty, NumericProperty+
 from kivy.lang import Builder from kivy.lang import Builder
  
Ligne 33: Ligne 34:
             Rectangle:             Rectangle:
                 # self.size = taille du BoxLayout                 # self.size = taille du BoxLayout
-                size: self.size[0]/2, self.size[0]/ # l'image est carrée +                size: root.taille 
-                pos: self.pos+                pos: 200, 200
                 source: "labo.png"                 source: "labo.png"
 ''') ''')
  
 class Main(Screen): class Main(Screen):
-    pass+    # Attibut de class accessible dans kv avec root.taille 
 +    taille = ListProperty([200, 200]) 
 + 
 +    # taille peut être modifié ensuite avec l'attribut self.taille
  
 class FondBlancApp(App): class FondBlancApp(App):
Ligne 49: Ligne 53:
 </code> </code>
  
-{{tag>kivy sb}}+{{tag>kivy sb python3}}
kivy_image_avec_alpha_sur_fond_blanc.txt · Dernière modification : 2020/10/29 13:50 de serge