public override void Execute()
        {
            if (!models.Display.PrevTexelPosition.HasValue)
            {
                models.Window.ShowInfoDialog("No pixel selected");
                return;
            }

            var tp = models.Display.PrevTexelPosition.Value;

            var colors = new List <PixelColorDialog.Element>();

            for (int i = 0; i < models.NumPipelines; ++i)
            {
                if (models.Pipelines[i].IsEnabled)
                {
                    var tex = models.Pipelines[i].Image;
                    if (tex == null)
                    {
                        continue;
                    }

                    var color = models.GetPixelValue(tex, new Size3(tp.X, tp.Y, tp.Z),
                                                     models.Display.ActiveLayerMipmap, models.Display.TexelRadius);

                    colors.Add(new PixelColorDialog.Element(color, i, models.Statistics[i].Stats.HasAlpha));
                }
            }

            if (colors.Count > 0)
            {
                var dia = new PixelColorDialog(colors, tp, models.Images.Is3D);
                models.Window.ShowDialog(dia);
            }
        }
Ejemplo n.º 2
0
        public override void Execute()
        {
            var colors = new List <PixelColorDialog.Element>();

            for (int i = 0; i < models.NumPipelines; ++i)
            {
                if (models.Pipelines[i].IsEnabled)
                {
                    var tex = models.Pipelines[i].Image;
                    if (tex == null)
                    {
                        continue;
                    }

                    var color = models.GetPixelValue(tex, new Size3(models.Display.TexelPosition.X, models.Display.TexelPosition.Y, 0),
                                                     models.Display.ActiveLayer, models.Display.ActiveMipmap, models.Display.TexelRadius);

                    colors.Add(new PixelColorDialog.Element(color, i, models.Statistics[i].Stats.HasAlpha));
                }
            }

            if (colors.Count > 0)
            {
                var dia = new PixelColorDialog(colors);
                models.Window.ShowDialog(dia);
            }
        }
Ejemplo n.º 3
0
        public void Execute(object parameter)
        {
            var colors = new List <PixelColorDialog.Element>();

            for (int i = 0; i < models.Equations.NumEquations; ++i)
            {
                if (models.Equations.Get(i).Visible)
                {
                    colors.Add(new PixelColorDialog.Element(models.Equations.Get(i).TexelColor, i));
                }
            }

            if (colors.Count > 0)
            {
                var dia = new PixelColorDialog(colors);
                dia.Owner = models.App.Window;
                dia.ShowDialog();
            }
        }