private static IBitmapSource <ColorPbgra32> CreateBufferedTileScaler(IImagingFactory imagingFactory, IBitmapSource <ColorBgra32> source, int dstWidth, int dstHeight, BitmapInterpolationMode interpolationMode)
        {
            IBitmapSource <ColorPbgra32> source5;

            using (IBitmap <ColorBgra32> bitmap = BitmapAllocator.Bgra32.Allocate <ColorBgra32>(source.Size.Width, imagingFactory.GetBufferBitmapHeight(source, 7), AllocationOptions.Default))
            {
                using (IBitmapSource <ColorBgra32> source2 = imagingFactory.CreateBufferedBitmap <ColorBgra32>(source, bitmap, 7))
                {
                    using (IBitmapSource <ColorPbgra32> source3 = imagingFactory.CreateFormatConvertedBitmap <ColorPbgra32>(source2))
                    {
                        source5 = imagingFactory.CreateBitmapScaler <ColorPbgra32>(source3, dstWidth, dstHeight, interpolationMode);
                    }
                }
            }
            return(source5);
        }
Beispiel #2
0
 public static IBitmapSource CreateFormatConvertedBitmap(this IImagingFactory factory, IBitmapSource source, PixelFormat dstFormat) =>
 factory.CreateFormatConvertedBitmap(source, dstFormat, BitmapDitherType.None, null, 0.0, BitmapPaletteType.Custom);
Beispiel #3
0
        public static IBitmapSource <TPixel> CreateFormatConvertedBitmap <TPixel>(this IImagingFactory factory, IBitmapSource source, BitmapDitherType dither, IPalette palette, double alphaThresholdPercent, BitmapPaletteType paletteTranslate) where TPixel : struct, INaturalPixelInfo
        {
            TPixel local = default(TPixel);

            return((IBitmapSource <TPixel>)factory.CreateFormatConvertedBitmap(source, local.PixelFormat, dither, palette, alphaThresholdPercent, paletteTranslate));
        }
Beispiel #4
0
 public static IBitmapSource <TPixel> CreateFormatConvertedBitmap <TPixel>(this IImagingFactory factory, IBitmapSource source) where TPixel : struct, INaturalPixelInfo =>
 factory.CreateFormatConvertedBitmap <TPixel>(source, BitmapDitherType.None, null, 0.0, BitmapPaletteType.Custom);