Наследование: System.Windows.Forms.UserControl
Пример #1
0
        public Canvas( ImageInfo image, ToolPanel toolInfoPanel )
        {
            myOnParentResizeHandler = new EventHandler( OnParentResize );
            myOnParentMouseEnterHandler = new EventHandler( OnParentMouseEnter );
            myOnParentDisposedHandler = new EventHandler( OnParentDisposed );

            myCurrentLayerIndex = 0;

            myMovingSelected = false;
            mySelectingPixels = false;
            myDrawingPencil = false;
            myDrawingBox = false;

            Image = image;
            myToolPanel = toolInfoPanel;

            mySelectedPixels = new bool[ image.Width, image.Height ];
            mySelectedArea = 0;
            mySelectedRegion = new Region( Rectangle.Empty );
            myScaledRegion = new Region( Rectangle.Empty );

            Size = new Size( image.Width * 8, image.Height * 8 );
            BorderStyle = BorderStyle.FixedSingle;

            DoubleBuffered = true;

            InitializeComponent();
        }
Пример #2
0
        public Canvas(ImageInfo image, ToolPanel toolInfoPanel)
        {
            myOnParentResizeHandler     = new EventHandler(OnParentResize);
            myOnParentMouseEnterHandler = new EventHandler(OnParentMouseEnter);
            myOnParentDisposedHandler   = new EventHandler(OnParentDisposed);

            myCurrentLayerIndex = 0;

            myMovingSelected  = false;
            mySelectingPixels = false;
            myDrawingPencil   = false;
            myDrawingBox      = false;

            Image       = image;
            myToolPanel = toolInfoPanel;

            mySelectedPixels = new bool[image.Width, image.Height];
            mySelectedArea   = 0;
            mySelectedRegion = new Region(Rectangle.Empty);
            myScaledRegion   = new Region(Rectangle.Empty);

            Size        = new Size(image.Width * 8, image.Height * 8);
            BorderStyle = BorderStyle.FixedSingle;

            DoubleBuffered = true;

            InitializeComponent();
        }
Пример #3
0
        private void SetupCanvas(ToolPanel toolInfoPanel)
        {
            Tab            = new TabPage(TabName);
            Tab.ImageIndex = 0;
            Tab.BackColor  = SystemColors.ControlDark;

            Canvas      = new Canvas(this, toolInfoPanel);
            Canvas.Name = "canvas";
            Tab.Controls.Add(Canvas);
        }
Пример #4
0
        public ImageInfo(ToolPanel toolInfoPanel, String filePath)
        {
            ActionStack = new ActionStack();

            FilePath = filePath;

            SetupDefaultGrid();
            Load(filePath);
            SetupCanvas(toolInfoPanel);

            Modified = false;
        }
Пример #5
0
        public ImageInfo( ToolPanel toolInfoPanel, String filePath )
        {
            ActionStack = new ActionStack();

            FilePath = filePath;

            SetupDefaultGrid();
            Load( filePath );
            SetupCanvas( toolInfoPanel );

            Modified = false;
        }
Пример #6
0
        public ImageInfo(ToolPanel toolInfoPanel, int width, int height, String name = "untitled.png")
        {
            ActionStack = new ActionStack();

            Size     = new Size(width, height);
            FilePath = name;

            SetupDefaultGrid();
            SetupCanvas(toolInfoPanel);

            Layers = new List <Layer>();
            Layers.Add(new Layer(this));

            Modified = true;
        }
Пример #7
0
        public ImageInfo( ToolPanel toolInfoPanel, int width, int height, String name = "untitled.png" )
        {
            ActionStack = new ActionStack();

            Size = new Size( width, height );
            FilePath = name;

            SetupDefaultGrid();
            SetupCanvas( toolInfoPanel );

            Layers = new List<Layer>();
            Layers.Add( new Layer( this ) );

            Modified = true;
        }
Пример #8
0
        private void SetupCanvas( ToolPanel toolInfoPanel )
        {
            Tab = new TabPage( TabName );
            Tab.ImageIndex = 0;
            Tab.BackColor = SystemColors.ControlDark;

            Canvas = new Canvas( this, toolInfoPanel );
            Canvas.Name = "canvas";
            Tab.Controls.Add( Canvas );
        }