0

I am converting one of the C# WPF based MS kinect example. To a MS form based version, as I want it to work with an older application. I'm not really into WPF. I've included the same libraries as in the WPF app to my MS-Forms app (including the PresentationFrameWork)

There is on critical part to me that so far i'm unable to convert. In the WPF i read:

this.Image.Source = this.colorBitmap;

Which seams to point to a WPF image (from the image toolbox). And this reflects the main form

There is no "image" as in MS forms, the most closest thing to it is picturebox, So i dragged a picturebox on my main form and renamed it to Image However a picturebox doesn't have a picturebox. source property. I've tried the image atribute of it. So now my line reads

this.Image.Image = this.colorbitmap;   
// note first image statement is renamed picturebox1 

However then i get a error

Error 2 Cannot implicitly convert type 'System.Windows.Media.Imaging.WriteableBitmap' to 'System.Drawing.Image' D:\Projects\KinectDepth\KinectDepth\KinectDepth\Form1.cs 114 36 KinectDepth

Does anyone know how to resolve this, since my WPF knowledge is close to zero and i'm a beginner in C#, i find it hard to resolve this issue, since all googling endsup in WPF code in which i am not into at all.

user613326
  • 2,140
  • 9
  • 34
  • 63

0 Answers0