1
import wpf
from System.Windows import Application, Window,MessageBox
from Main import *
from Sign_Up import *
import System
from System.Windows.Controls import *
from System.Windows.Input import *
from System import Uri
from System.Windows.Media.Imaging import BitmapImage
from System.Windows.Media import ImageBrush
class MyWindow(Window):
def __init__(self):
wpf.LoadComponent(self, 'Sign_In.xaml')
brush = ImageBrush()
image = Image()
image.Source = BitmapImage(Uri("C:\Users\Chen\Pictures\1-150511225359.jpg"))
brush.ImageSource = image.Source
self.SignUpGrid.Background = brush
我試圖在wpf IronPython中設置一個窗口的背景圖像,我不斷收到語法錯誤。設置python的背景圖像
你得到什麼錯誤? – wmk
我正在使用Visual Studio和IronPython,它只給我一般的錯誤區域而不是錯誤 –