Exemplo n.º 1
0
        public override void refreshPropertyToPanel()
        {
            this.Id        = _attrib.ID;
            this.Width     = _attrib.Rect.Width;
            this.Height    = _attrib.Rect.Height;
            this.Location  = new Point(_attrib.Rect.X, _attrib.Rect.Y);
            this.BackColor = Color.Green;
            this.IsMoved   = !_attrib.Lock;

            if (_attrib.VarName.Count != 0)
            {
                _attrib.VarList = String.Join(",", _attrib.VarName);
            }
            else
            {
                _attrib.VarList = "未设置变量";
            }

            if (_attrib.Pic.BitmapArray.Count > 0)
            {
                SVBitmap svbitMap = _attrib.Pic.BitmapArray[0];
                this.BackgroundImage = svbitMap.bitmap();
            }
            else
            {
                this.BackgroundImage = _defaultBackGround;
            }
        }
Exemplo n.º 2
0
        public override void PaintValue(PaintValueEventArgs e)
        {
            SVBitmap bitmap = e.Value as SVBitmap;

            if (bitmap == null)
            {
                return;
            }

            if (bitmap.ImageFileName == null || bitmap.ShowName == null)
            {
                return;
            }

            Rectangle rect   = new Rectangle(1, 1, 19, 17);
            var       bitMap = bitmap.bitmap();

            if (bitMap == null)
            {
                return;
            }

            e.Graphics.DrawImage(bitMap, rect);
        }