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; }
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); }
/// <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]); } }