c# - VS2015 icon guide - color inversion -
i downloaded set of vs2015 icons , reading through msdn guide
under "using color in images", stated "in order make icons appear correct contrast ratio in visual studio dark theme, inversion applied programmatically."
i'm trying mimic behavior in application when apply color inversion image, doesn't come out way looks in vs's dark theme:
does know how vs inverts colors can mimic this?
edit: inversion code i'm using - issue appear edges transparency/alpha:
public static void invertcolors(bitmap bitmapimage) { var bitmapread = bitmapimage.lockbits(new rectangle(0, 0, bitmapimage.width, bitmapimage.height), imagelockmode.readonly, pixelformat.format32bpppargb); var bitmaplength = bitmapread.stride * bitmapread.height; var bitmapbgra = new byte[bitmaplength]; marshal.copy(bitmapread.scan0, bitmapbgra, 0, bitmaplength); bitmapimage.unlockbits(bitmapread); (int = 0; < bitmaplength; += 4) { bitmapbgra[i] = (byte)(255 - bitmapbgra[i]); bitmapbgra[i + 1] = (byte)(255 - bitmapbgra[i + 1]); bitmapbgra[i + 2] = (byte)(255 - bitmapbgra[i + 2]); } var bitmapwrite = bitmapimage.lockbits(new rectangle(0, 0, bitmapimage.width, bitmapimage.height), imagelockmode.writeonly, pixelformat.format32bpppargb); marshal.copy(bitmapbgra, 0, bitmapwrite.scan0, bitmaplength); bitmapimage.unlockbits(bitmapwrite); }
you can use ivsuishell5.themedibits method apply in-place inversion. there themedimagesourceconverter wpf helper class create inverted image.
Comments
Post a Comment