コード例 #1
0
ファイル: AppHelper.cs プロジェクト: Grommini/x360ce
 public static Bitmap GetDisabledImage(Bitmap image)
 {
     var effects = new JocysCom.ClassLibrary.Drawing.Effects();
     var newImage = (Bitmap)image.Clone();
     effects.GrayScale(newImage);
     effects.Transparent(newImage, 50);
     return newImage;
 }
コード例 #2
0
ファイル: AppHelper.cs プロジェクト: akemimadoka/x360ce
        public static Bitmap GetDisabledImage(Bitmap image)
        {
            var effects  = new JocysCom.ClassLibrary.Drawing.Effects();
            var newImage = (Bitmap)image.Clone();

            effects.GrayScale(newImage);
            effects.Transparent(newImage, 50);
            return(newImage);
        }
コード例 #3
0
 /// <summary>
 /// Generates disabled Image. Images are cached so do not use method for random images.
 /// </summary>
 public static Bitmap GetDisabledImage(Bitmap image)
 {
     lock (DisabledImageLock)
     {
         if (!DisabledImageCache.ContainsKey(image))
         {
             var effects  = new JocysCom.ClassLibrary.Drawing.Effects();
             var newImage = (Bitmap)image.Clone();
             effects.GrayScale(newImage);
             effects.Transparent(newImage, 50);
             DisabledImageCache.Add(image, newImage);
         }
         return(DisabledImageCache[image]);
     }
 }