private static bool TryFindColorIndex(PixelFormatChannelMask mask, out int index) { var maskList = mask.Mask; for (int i = 0, count = maskList.Count; i < count; i++) { if (maskList[i] == 255) { index = i; return(true); } } index = -1; return(false); }
private void ChannelMaskView_CurrentChanged(object sender, System.EventArgs e) { _maskCollection.Clear(); if (_channelMaskView.CurrentItem != null) { try { PixelFormatChannelMask current = (PixelFormatChannelMask)_channelMaskView.CurrentItem; if (current.Mask != null && current.Mask.Any()) { _maskCollection.AddRange(current.Mask); _maskView.MoveCurrentToFirst(); } } catch { } } }