Here is my piece of code, but I have an error
No image component suitable for completing this operation was found.
in the line < EndInit () .
I read the WIC registry modification (NB: my OS is Windows 7 and my IDE is VS 2010), but it does not work at all: (
I was wondering if you tell me what to do to solve this problem.
BitmapImage myBitmapImage = new BitmapImage(); byte[] DM = new byte[307200]; for (int i = 0; i < 640; i++) for (int j = 0; j < 480; j++) if (i < 500) DM[i + j] = i; using (System.IO.MemoryStream memoryStream = new System.IO.MemoryStream(DM)) { myBitmapImage.BeginInit(); myBitmapImage.StreamSource = memoryStream; myBitmapImage.DecodePixelWidth = 640; myBitmapImage.EndInit(); } img.Source = myBitmapImage;
source share