WriteableBitmap wb = new WriteableBitmap((int)this.ActualWidth, (int)this.ActualHeight);
wb.Render(this, null);
wb.Invalidate();
MemoryStream ms = new MemoryStream();
int h = 212;
int w = 444;
wb.SaveJpeg(ms, w, h, 0, 100); // The parameter is incorrect
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.SetSource(ms);
image1.Source = bitmapImage;