Exemplo n.º 1
0
        public static IComObject <IWICBitmap> CreateBitmapFromSourceRect(this IWICImagingFactory factory, IWICBitmapSource source, int x, int y, int width, int height)
        {
            if (factory == null)
            {
                throw new ArgumentNullException(nameof(factory));
            }

            if (source == null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            factory.CreateBitmapFromSourceRect(source, x, y, width, height, out var value).ThrowOnError();
            return(new ComObject <IWICBitmap>(value));
        }
Exemplo n.º 2
0
 public static IWICBitmap CreateBitmapFromSourceRect(this IWICImagingFactory imagingFactory, IWICBitmapSource pIBitmapSource, WICRect rect)
 {
     return(imagingFactory.CreateBitmapFromSourceRect(pIBitmapSource, rect.X, rect.Y, rect.Width, rect.Height));
 }