2013-04-08 94 views
-1

我會解釋我想要做的事情:讓我們以這個picture爲例。我想下載這張照片,並使用Picture Box在我的應用程序中打開它。我想我需要使用
Bitmap bitmap = new Bitmap(xxxx); ,我應該在「xxxx」地方放什麼?我看到的腳本是用Delphi編寫的,看起來像這樣:從網上獲取圖像

Value := copys (searchPage, '<link rel="image_src" href="', '">'); 
GetPicture (Value); 

有什麼建議嗎?

+0

當你研究這個時,你發現了什麼?如果我們知道您在嘗試自己做這件事時遇到了什麼問題,那將會更容易。 – Patrick 2013-04-08 19:50:33

+0

@Patrick - 我不知道如何下載圖像,然後將它加載到圖片框中,因爲我是新手,而且這是我自己做的第一件事。jac - 不知道如何命名我的問題,所以我找不到你鏈接的東西。感謝大家的幫助。 – PotatoBox 2013-04-08 20:05:08

回答

1
Image i = new Image(); 
BitmapImage src = new BitmapImage(); 
src.BeginInit(); 
src.UriSource = new Uri("http://i.stack.imgur.com/glbMA.jpg"); 
src.EndInit(); 
i.Source = src;