You are not using
System.Windows.Forms
in this part of code, using only
System.Drawing
and only for a bitmap. You can keep this code in WPF without any problems. No "conversion" will be needed.
However, please see my comment to the question.
If, by some reason, you don't like it, you can use the class
System.Windows.Media.Imaging.WriteableBitmap
:
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.writeablebitmap.aspx[
^].
—SA