2013-04-16 37 views
0

我有一個writeablebitmap對象,我想將它保存爲silverlight中的JPG,我該怎麼做?在silverlight中將writeablebitmap保存爲JPG

+1

可能重複的操作:我怎麼能轉換到WriteableBitmap的jpg或其他常見格式?](http://stackoverflow.com/questions/4683276/how-can-i-convert-writeablebitmap-to-jpg-or-some-other-common-format) – StaWho

+1

使用ImageTools for sl HTTP ://imagetools.codeplex.com/ –

回答

2

我也將WriteableBitmap的對象爲圖像作爲

WriteableBitmap bitmap = new WriteableBitmap(Width,Height); 

//一些位圖繪製

然後

Image imageFHR = new Image(); 
imageFHR.Source = bitmap; 
imageFHR.Height = Height; 
imageFHR.Width = Width; 
myCanvas.Children.Add(imageFHR); 
+0

非常感謝:),我也使用了ImageTools庫的擴展方法來做到這一點 –