Exemple #1
0
        public void SetCanvas(PictureBoxObj pb)
        {
            lock (_canvasSync)
            {
                if (pb == null || pb.Image == null)
                {
                    return;
                }

                Width  = pb.Width;
                Height = pb.Height;

                _backPicture = pb;
                this.Controls.Add(_backPicture);
                _backPicture.SendToBack();
                _backPicture.Invalidate();


                _frontPicture = new PictureBoxObj(_backPicture.ClientID, _backPicture.UniqueID, PictureBoxStatus.Canvas);
                this.Controls.Add(_frontPicture);

                _frontPicture.Width  = pb.Width;
                _frontPicture.Height = pb.Width;
                _frontPicture.Image  = new Bitmap(Width, Height);
                _frontPicture.BringToFront();

                _editPBDrawObjects[0] = new DrawObjectList(0);
            }

            _isCleared = false;
            _needUpdateFrontPicture = true;
            AppLogger.Log("Picture loaded: width " + Width + ", height " + Height);
        }
Exemple #2
0
        public PDrawRect(PictureBoxObj drawBox, Point startPoint, int brushSize, Color color)
        {
            _picture           = drawBox;
            _picture.BackColor = Color.Transparent;

            _brushSize = brushSize < 1 ? 1 : brushSize;
            _color     = color;

            _startX = startPoint.X;
            _startY = startPoint.Y;
            _picture.BringToFront();
        }
        public PSelectorRect(PictureBoxObj drawBox, Point startPoint, PictureBoxObj sourceBox, bool isCutted)
        {
            _picture           = drawBox;
            _source            = sourceBox;
            _picture.BackColor = Color.Transparent;

            _needCopy = false;
            _isCutted = isCutted;

            _startX = startPoint.X;
            _startY = startPoint.Y;
            _picture.BringToFront();
        }
Exemple #4
0
        private PictureBoxObj CreateNewPictureBox(Image img, Point location)
        {
            //Create facepictureBox
            PictureBoxObj pic = new PictureBoxObj(_netClient.ClientID, Uid64.CreateNew().Data, PictureBoxStatus.IsMovable);

            if (img != null)
            {
                pic.Image  = img;
                pic.Width  = img.Width;
                pic.Height = img.Height;
            }
            SubscribeControl(pic);
            pic.BorderStyle = BorderStyle.FixedSingle;
            pic.BringToFront();
            pic.Parent   = _canvas.FrontPicture;
            pic.Location = location;

            //Send it to serever
            SendComNewPictureBox(pic);
            return(pic);
        }