Esempio n. 1
0
        private void button7_Click(object sender, EventArgs e)
        {
            layer l = new layer(_layerContainer);

            _layerContainer.Add(l);
            refLayerMon();
        }
Esempio n. 2
0
        private void btnLayerDown_Click(object sender, EventArgs e)
        {
            layer tmp    = _layerContainer[selectedLayerIndex];
            int   newPos = selectedLayerIndex + 1;

            _layerContainer.RemoveAt(selectedLayerIndex);
            _layerContainer.Insert(newPos, tmp);
            selectedLayerIndex++;
            refLayerMon();
            refCanvas();
        }
Esempio n. 3
0
        private void addItemBtn_Click(object sender, EventArgs e)
        {
            //handling adding items
            layer l = new layer(_layerContainer);

            int newItemX = (int)addItemSize_X.Value;
            int newItemY = (int)addItemSize_Y.Value;

            if (addItemSelect.SelectedIndex == 0)
            {
                //image
                using (OpenFileDialog dlg = new OpenFileDialog())
                {
                    dlg.Title = "Open Input File";

                    if (dlg.ShowDialog() == DialogResult.OK)
                    {
                        Bitmap loaded = (Bitmap)Image.FromFile(dlg.FileName);
                        l.image            = new Bitmap(loaded.Width, loaded.Height);
                        l.pureBitmap       = (Bitmap)loaded.Clone();
                        l.sizeOfPureBitmap = new Size(l.pureBitmap.Width, l.pureBitmap.Height);
                        l.g = Graphics.FromImage(l.image);
                        l.g.DrawImage(loaded, 0, 0);
                    }
                }
            }
            if (addItemSelect.SelectedIndex == 1)
            {
                //string
            }
            if (addItemSelect.SelectedIndex == 2)
            {
                //trans square
                l.g.DrawRectangle(currentPen, 0, 0, newItemX, newItemY);
                l.pureBitmap       = (Bitmap)l.image.Clone();
                l.sizeOfPureBitmap = new Size(l.pureBitmap.Width, l.pureBitmap.Height);
            }
            if (addItemSelect.SelectedIndex == 3)
            {
                //filled square
                l.g.FillRectangle(currentBrush, 0, 0, newItemX, newItemY);
                l.pureBitmap       = (Bitmap)l.image.Clone();
                l.sizeOfPureBitmap = new Size(l.pureBitmap.Width, l.pureBitmap.Height);
            }
            if (addItemSelect.SelectedIndex == 4)
            {
                //trans circle
                l.g.DrawEllipse(currentPen, 0, 0, newItemX, newItemY);
                l.pureBitmap       = (Bitmap)l.image.Clone();
                l.sizeOfPureBitmap = new Size(l.pureBitmap.Width, l.pureBitmap.Height);
            }
            if (addItemSelect.SelectedIndex == 5)
            {
                //filled circle
                l.g.FillEllipse(currentBrush, 0, 0, newItemX, newItemY);
                l.pureBitmap       = (Bitmap)l.image.Clone();
                l.sizeOfPureBitmap = new Size(l.pureBitmap.Width, l.pureBitmap.Height);
            }

            _layerContainer.Add(l);
            selectedLayerIndex = _layers.Items.Count;
            refLayerMon();
            refCanvas();
        }