如何分配圖片Image.Source:Image.Source =「圖片\ 1.bmp」 - 不工作(不能分配圖片)分配圖像Image.Source
1
A
回答
0
不要忘記將「1.bmp」的生成操作設置爲資源
0
MSDN http://msdn.microsoft.com/en-us/library/system.windows.controls.image.source.aspx上的Image.Source頁面有一個示例。您需要分配一個ImageSource,而不是一個字符串。 (當然看到上面的帖子的Pack URI)
1
Image myImage3 = new Image();
BitmapImage bi3 = new BitmapImage();
bi3.BeginInit();
bi3.UriSource = new Uri("smiley_stackpanel.PNG", UriKind.Relative);
bi3.EndInit();
myImage3.Stretch = Stretch.Fill;
myImage3.Source = bi3;
相關問題
- 1. 在wpf中將圖像追加到image.source
- 2. Emgu.Cv WPF(C#)如何從圖像框(image.source)加載圖像
- 3. Image.Source
- 4. XPM圖像內存分配
- 5. 分配圖像PHP變量
- 6. 分配URI來圖像源
- 7. 在Image.Source我的PNG圖像不被混合(XAML)支持
- 8. 將Image.Source設置爲有效數據時未顯示圖像
- 9. 使用隨機分配圖像爲所有JButton分配相同的圖像
- 10. 在image.source不圖使用轉換器
- 11. Image.Source使用代理
- 12. 用button改變image.source?
- 13. 分配圖像視圖到背景圖像的按鈕
- 14. Android的位圖分配每像素
- 15. 刪除圖像大小分配 - wordpress
- 16. C++動態分配(像素圖)
- 17. 如何在變量中分配圖像?
- 18. Rails:如何分配鏈接到圖像
- 19. android:在哪裏分配圖像資源?
- 20. EMGU CV重新分配圖像
- 21. 爲圖像分配一個值
- 22. SWIFT - UIimagepicker將圖像分配到數組
- 23. 引起的圖像的分配的UIImageView
- 24. 將var分配給圖像名稱(php)
- 25. 問題在分配圖像的UIImageView iPhone
- 26. ImageArray分配給單個圖像
- 27. 分配隨機背景圖像面板
- 28. jQuery的分配圖像連續元素
- 29. 從attr分配背景圖像
- 30. 如何爲圖像分配值