Пример #1
0
        public void SetTexture(string texturePath, WindowRenderTarget target)
        {
            BitmapHandler  bmpHandler = new BitmapHandler();
            ImagingFactory factory    = new ImagingFactory();

            var             bmps            = bmpHandler.LoadBMPSFromFile(texturePath, factory, ImageFormat.Bmp);
            FormatConverter formatConverter = new FormatConverter(factory);

            formatConverter.Initialize(bmps, SharpDX.WIC.PixelFormat.Format32bppPBGRA, BitmapDitherType.Spiral8x8, null, 0f, BitmapPaletteType.MedianCut);
            ObjectBitmap = SharpDX.Direct2D1.Bitmap.FromWicBitmap(target, formatConverter);
        }