Esempio n. 1
0
        protected override void OnCreateControl()
        {
            base.OnCreateControl();

            var splitContainer = new MultiSplitContainer {
                Dock = DockStyle.Fill
            };

            _image = new ImageRenderControl(ProjectFile.File.FullName)
            {
                Width = 300, Height = 300
            };
            splitContainer.AddPanel(new ScrollableView(_image));

            /* Image = new Bitmap(picture.HorizontalResolution, picture.VerticalResolution);
             *
             * g = Graphics.FromImage(b);
             *
             * rect = new Rectangle(0, 0, 1600, 900);
             * //  sourceRect = new Rectangle(new Point(0, 0), new Size(picture.Width, picture.Height));
             * sourceRect = new Rectangle(0, 0, picture.Width, picture.Height);
             *
             * g.DrawImage(picture, rect, sourceRect, GraphicsUnit.Pixel);*/

            PipelineSettings = new ImagePipelineSettings(ProjectFile, _image);
            PipelineSettings.PipelineChanged += () => { Pristine = false; };
            splitContainer.AddPanel(PipelineSettings).StaticWidth = 310;

            Controls.Add(splitContainer);
        }
Esempio n. 2
0
        public ImagePipelineSettings(AsmProjectFile file, ImageRenderControl image)
        {
            _loading = true;
            _file    = file;
            InitializeComponent();

            NewPipelineType.Items.Clear();
            NewPipelineType.Items.AddRange(_imagePipelineChoices.Select(o => o.Value).ToArray());

            if (file.Pipeline != null)
            {
                Pipeline = file.Pipeline.Clone(true);
            }
            PaletteReductionPanel = new PaletteReductionSettings(PipelineAsChr, image)
            {
                Dock = DockStyle.Top
            };
            ChrPipelinePanel = new ChrPipelineSettings(PipelineAsChr, image)
            {
                Dock = DockStyle.Top
            };

            PaletteReductionPanel.PipelineChanged += RegisterChange;
            ChrPipelinePanel.PipelineChanged      += RegisterChange;

            Controls.Add(ChrPipelinePanel);
            Controls.Add(PaletteReductionPanel);

            RefreshLayout();
            _loading = false;
        }
 public PaletteReductionSettings(ChrPipeline pipeline, ImageRenderControl image)
 {
     _loading = true;
     Pipeline = pipeline;
     _image   = image;
     InitializeComponent();
     RefreshLayout();
     _loading = false;
 }
Esempio n. 4
0
        public ChrPipelineSettings(ChrPipeline pipeline, ImageRenderControl image)
        {
            _loading       = true;
            Pipeline       = pipeline;
            _paletteSource = image.Palette;
            InitializeComponent();
            RefreshLayout();
            _loading = false;

            PaletteEntries.OrderUpdated   += () => { SetPaletteAssignments(); };
            PaletteEntries.MouseOverColor += (colors) => { PreviewPaletteColor(colors); };
            image.PaletteChanged          += () =>
            {
                _loading = true;
                RefreshLayout();
                _loading = false;
            };
        }