Reputation: 3432
The below snippet darkens the entire image but I wish to darken all the parts except the background. How would one go about doing this? You will notice the png below has no background so I am not sure why this doesn't work.
I am guessing it is something to do with how the image is loaded into memory from the file and alpha channels etc.
SKImage image = SKImage.FromBitmap(resourceBitmap);
var skImageFilter = SKImageFilter.CreateColorFilter(SKColorFilter.CreateBlendMode(AppColors.DarkGreyColor.ToSKColor(),
SKBlendMode.Darken));
image = image.ApplyImageFilter(
skImageFilter, new SKRectI(0,0, image.Width,image.Height), new SKRectI(0, 0, image.Width, image.Height), out SKRectI subSet, out SKPoint point);
Upvotes: 1
Views: 757