示例#1
0
        /// <summary>
        ///     Create with your own providing logic
        /// </summary>
        /// <param name="dpiHandler">DpiHandler</param>
        /// <param name="bitmapProvider">A function which provides the requested bitmap</param>
        /// <param name="bitmapScaler">A function to provide a newly scaled bitmap</param>
        public static BitmapScaleHandler <TKey> Create <TKey>(DpiHandler dpiHandler, Func <TKey, uint, Bitmap> bitmapProvider, Func <Bitmap, uint, Bitmap> bitmapScaler = null)
        {
            var scaleHandler = new BitmapScaleHandler <TKey>();

            scaleHandler.Initialize(dpiHandler, bitmapProvider, bitmapScaler);
            return(scaleHandler);
        }
        /// <summary>
        ///     Create with your own providing logic
        /// </summary>
        /// <param name="dpiHandler">DpiHandler</param>
        /// <param name="bitmapProvider">A function which provides the requested bitmap</param>
        /// <param name="bitmapScaler">A function to provide a newly scaled bitmap</param>
        public static BitmapScaleHandler <TKey, TValue> Create <TKey, TValue>(DpiHandler dpiHandler, Func <TKey, uint, TValue> bitmapProvider, Func <TValue, uint, TValue> bitmapScaler = null) where TValue : IDisposable
        {
            var scaleHandler = new BitmapScaleHandler <TKey, TValue>();

            scaleHandler.Initialize(dpiHandler, bitmapProvider, bitmapScaler);
            return(scaleHandler);
        }