2012-12-24 1 views
0

기존 구성 요소에 대한 다음 코드 단편을 Silverlight로 변환하는 데 문제가 있습니다. 데이터 및 byte[]widthheightMarshal.Copy 비트 맵을 Silverlight로 변환하기

Bitmap bmp = new Bitmap(width, height); 
BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb); 
Marshal.Copy(data, 0, bmpData.Scan0, data.Length); 
bmp.UnlockBits(bmpData); 

이 필요한 화상의 폭과 높이이다.

누구든지 이에 대한 아이디어를 공유 할 수 있습니까?

답변

0
using (MemoryStream ms = new MemoryStream(imageBytes, 0, imageBytes.Length)) 
{ 
    BitmapImage im = new BitmapImage(); 
    im.SetSource(ms); 
    this.imageControl.Source = im; 
}