1
Image myImage3 = new Image();
BitmapImage bi3 = new BitmapImage();
bi3.BeginInit();
bi3.UriSource = new Uri(@"C:\Users\User\Desktop\Awesomeness\PicProgram\Program\bin\Debug\flower.png", UriKind.Relative);
bi3.EndInit();
myImage3.Stretch = Stretch.Fill;
myImage3.Source = bi3;
我想知道如何將myImage3添加到窗口中。將新創建的圖像對象添加到窗口
我試過this.content.add.myImage3
或this.add(myImage3)
和其他變化似乎沒有工作。
有什麼建議嗎?
感謝
@ _the_Down-voter:嘗試提供反饋意見,告訴您爲什麼您的投票或新用戶不知道他們需要如何改進他們的問題。 – Josh 2012-03-18 06:51:27
你想把這個圖像添加到特定的控件或表單背景嗎?對你想要完成的事情有一個更具體的瞭解。 – Josh 2012-03-18 06:52:20
@Josh我想在c#中創建一個圖像控件,然後將其添加到WPF窗口。我不希望它佔用整個頁面,如背景 – user1219627 2012-03-18 16:44:48