Inheritance: 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 );
        }