How to convert a WPF WriteableBitmap object to System.Drawing.Image?
My WPF client application sends raster data to the web service, and the web service needs to create System.Drawing.Image for this purpose.
I know that I can get WriteableBitmap data, send information to a web service:
// WPF side: WriteableBitmap bitmap = ...; int width = bitmap.PixelWidth; int height = bitmap.PixelHeight; int[] pixels = bitmap.Pixels; myWebService.CreateBitmap(width, height, pixels);
But at the end of the web service, I do not know how to create System.Drawing.Image from this data.
// Web service side: public void CreateBitmap(int[] wpfBitmapPixels, int width, int height) { System.Drawing.Bitmap bitmap = ? // How can I create this? }
Judah himango
source share