protected override void UpdateSignType() { base.UpdateSignType(); _backColor = SignTypeHandler.ConvertColor(_backColor, SignType); _foreColor = SignTypeHandler.ConvertColor(_foreColor, SignType); _textEffect.UpdateEffectColor(SignType); }
protected override void UpdateSignType() { base.UpdateSignType(); _backColor = SignTypeHandler.ConvertColor(_backColor, SignType); tranColor = SignTypeHandler.ConvertColor(tranColor, SignType); }
public ShapeLine(int zoom, Point start, Point end, int width, Color foreColor, SignType signtype) : this(zoom, signtype) { this._startSignPoint = start; this._endSignPoint = end; this._borderWidth = width; this._borderColor = SignTypeHandler.ConvertColor(foreColor, signtype); }
public ShapeLine(int zoom, Point start, Point end, ShapePaintPropertyInfo lineInfo, SignType signtype) : this(zoom, signtype) { this._startSignPoint = start; this._endSignPoint = end; this._borderColor = SignTypeHandler.ConvertColor(lineInfo.BorderColor, signtype); this._borderWidth = lineInfo.BorderWidth; this.LineDashStyle = lineInfo.LineDashStyle; }
public void VisitDynamicVideo(ShapeDynamicVideo dynamicVideo) { Color c = SignTypeHandler.ConvertColor(Color.White, dynamicVideo.SignType); string str = string.IsNullOrEmpty(dynamicVideo.DataSource) ? "No Source" : dynamicVideo.DataSource; using (Brush b = new SolidBrush(c)) { Graphics.DrawString(str, new Font("Tahoma", 16), b, dynamicVideo.VirtualBounds); } }
public ShapeFontBase(SignType signType) : base(signType) { _font = new FontWrapper(); _textEffect = new TextEffect(); _font.PropertyChanged += new EventHandler <PropertyChangedEventArgs>(_font_PropertyChanged); _textEffect.PropertyChanged += new EventHandler <PropertyChangedEventArgs>(_textEffect_PropertyChanged); _foreColor = SignTypeHandler.ConvertColor(Color.BlueViolet, SignType); //_foreColor = Color.BlueViolet; }
public ShapeFigure(int zoom, int x, int y, int width, int height, Color lineColor, Color fillColor, bool filled, int lineWidth, DashStyle lineDashStyle, SignType signType) : this(signType) { _zoom = zoom; _borderColor = SignTypeHandler.ConvertColor(lineColor, signType); FillColor = SignTypeHandler.ConvertColor(fillColor, signType); Filled = filled; _borderWidth = lineWidth; SetRectangle(x, y, width, height); }
public ShapeFigure(int zoom, int x, int y, int width, int height, ShapePaintPropertyInfo rectInfo, SignType signType) : this(signType) { _zoom = zoom; _borderColor = SignTypeHandler.ConvertColor(rectInfo.BorderColor, signType); LineDashStyle = rectInfo.LineDashStyle; FillColor = SignTypeHandler.ConvertColor(rectInfo.FilledColor, signType); Filled = rectInfo.Filled; _borderWidth = rectInfo.BorderWidth; SetRectangle(x, y, width, height); }
protected override void UpdateSignType() { base.UpdateSignType(); _backColor = SignTypeHandler.ConvertColor(_backColor, SignType); _foreColor = SignTypeHandler.ConvertColor(_foreColor, SignType); foreach (var item in _childs) { item.SignType = SignType; } }
public ShapeLabel(SignType signType) : base(signType) { //_refCount++; _paintAction = PaintActionType.FrameFontSizeStyle; _text = DefaultText; _stringFormat.FormatFlags = StringFormatFlags.DisplayFormatControl; _stringFormat.Alignment = StringAlignment.Center; _foreColor = SignTypeHandler.ConvertColor(Color.BlueViolet, SignType); //_backColor = SignTypeHandler.ConvertColor(Color.Transparent, SignType); _font.Name = FontManager.GetProWriteFonts()[0]; _font.Size = 7; }
public Rectangle PaintImage(Graphics g, ref Rectangle bounds, bool isDrawToBmp) { Rectangle _destBounds = Rectangle.Empty; if (_image != null) { switch (_sizeMode) { case PictureBoxSizeType.StretchImage: PaintStretchImage(g, ref bounds); break; case PictureBoxSizeType.CenterImage: PaintCenterImage(g, ref bounds, ref _destBounds); break; case PictureBoxSizeType.Zoom: PaintZoom(g, ref bounds, ref imageBounds, ref _destBounds); break; default: PaintDefault(g, ref bounds); break; } if (_destBounds.Height == 0 || _destBounds.Width == 0) { CreateEditImage(bounds); } else { CreateEditImage(_destBounds); } } else { Color c = SignTypeHandler.ConvertColor(Color.White, SignType); g.DrawString("Picture", Tahoma_Font, _cache.GetSolidBrush(c), bounds); } base.DestBounds = _destBounds; return(_destBounds); }
internal void UpdateEffectColor(SignType signType) { _color = SignTypeHandler.ConvertColor(_color, signType); }
protected virtual void UpdateSignType() { _borderColor = SignTypeHandler.ConvertColor(_borderColor, _signType); }
protected override void UpdateSignType() { this.filledColor = SignTypeHandler.ConvertColor(filledColor, SignType); base.UpdateSignType(); }
public Rectangle PaintImage(Graphics g, ref Rectangle bounds, bool isDrawToBmp) { Rectangle imageBounds = Rectangle.Empty; Rectangle destBounds = Rectangle.Empty; int width; int height; int x; int y; //GraphicsUnit gu = GraphicsUnit.Pixel; if (_image != null) { switch (_sizeMode) { //case PictureBoxSizeType.Normal: // if (_orgiBounds != Rectangle.Empty) // { // bounds = _orgiBounds; // _orgiBounds = Rectangle.Empty; // } // width = bounds.Width < _image.Width ? bounds.Width : _image.Width; // height = bounds.Height < _image.Height ? bounds.Height : _image.Height; // destBounds = new Rectangle(bounds.Location, new Size(width, height)); // destBounds = FormatBoundsByZoom(destBounds, Zoom); // imageBounds = new Rectangle(0, 0, width, height); // break; //case PictureBoxSizeType.AutoSize: // _orgiBounds = bounds; // bounds = new Rectangle(_orgiBounds.Location, _image.Size); // break; case PictureBoxSizeType.StretchImage: if (_orgiBounds != RectangleF.Empty) { bounds = _orgiBounds; _orgiBounds = Rectangle.Empty; } destBounds = bounds; break; case PictureBoxSizeType.CenterImage: { Point loc = new Point(); if (_orgiBounds != Rectangle.Empty) { bounds = _orgiBounds; _orgiBounds = Rectangle.Empty; } width = bounds.Width < _image.Width ? bounds.Width : _image.Width; height = bounds.Height < _image.Height ? bounds.Height : _image.Height; loc.X = (_image.Width - width) / 2; loc.Y = (_image.Height - height) / 2; x = bounds.Location.X; y = bounds.Location.Y; if (bounds.Width > _image.Width) { x += (bounds.Width - _image.Width) / 2; } if (bounds.Height > _image.Height) { y += (bounds.Height - _image.Height) / 2; } destBounds = new Rectangle(x, y, width, height); destBounds = FormatBoundsByZoom(destBounds, Zoom); imageBounds = new Rectangle(loc, new Size(width, height)); break; } case PictureBoxSizeType.Zoom: { if (_orgiBounds != Rectangle.Empty) { bounds = _orgiBounds; _orgiBounds = Rectangle.Empty; } float wn = bounds.Width * 1f / _image.Width * 1f; float hn = bounds.Height * 1f / _image.Height * 1f; float n = wn < hn ? wn : hn; x = bounds.Location.X + bounds.Width / 2 - (int)(n * _image.Width) / 2; y = bounds.Location.Y + bounds.Height / 2 - (int)(n * _image.Height) / 2; destBounds = new Rectangle(x, y, (int)(n * _image.Width), (int)(n * _image.Height)); if (VirtualBounds.X % Zoom == 0 && VirtualBounds.Y % Zoom == 0 && VirtualBounds.Width % Zoom == 0 && VirtualBounds.Height % Zoom == 0) { destBounds = FormatBoundsByZoom(destBounds, Zoom); } break; } default: break; } //DrawImage(g, bounds); DrawImage(g, ref destBounds); } else { Color c = SignTypeHandler.ConvertColor(Color.White, SignType); g.DrawString("Video", ShapeImage.Tahoma_Font, _cache.GetSolidBrush(c), bounds); } return(destBounds); }