Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ScreenCapture = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(bmp.GetHbitmap(), IntPtr.Zero, System.Windows.Int32Rect.Empty, BitmapSizeOptions.FromWidthAndHeight(width, height));
- public static BitmapSource ToBitmapSource(this System.Drawing.Image source)
- {
- System.Drawing.Bitmap bitmap = new System.Drawing.Bitmap(source);
- var bitSrc = bitmap.ToBitmapSource();
- bitmap.Dispose();
- bitmap = null;
- return bitSrc;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement