コード例 #1
0
        /// <summary>
        /// Generate image tag for triangle
        /// </summary>
        protected override void OnPreRender(EventArgs e)
        {
            if (_activeOpacity > 0)
            {
                _activeColor = Draw.Utility.AdjustOpacity(_color, _activeOpacity);
            }
            if (_opacity < 100)
            {
                _color = Draw.Utility.AdjustOpacity(_color, _opacity);
            }
            string cacheKey = string.Format("triangle{0}{1}{2}{3}",
                                            _direction, this.Width, this.Height, _color.ToArgb());

            if (!this.TagInCache(cacheKey))
            {
                Idaho.Draw.Triangle draw = new Idaho.Draw.Triangle(_direction);

                draw.Width            = this.Width;
                draw.Height           = this.Height;
                draw.Color.ForeGround = _color;
                draw.Color.Highlight  = _activeColor;
                this.Src = draw.Url;
                this.Style.Add("width", string.Format("{0}px", this.Width));
                this.Style.Add("height", string.Format("{0}px", this.Height));
            }

            // attributes that aren't cached
            this.Transparency  = true;
            this.AlternateText = "";
            this.Generated     = true;
            base.OnPreRender(e);
        }
コード例 #2
0
        protected override void MakeGraphic()
        {
            if (_alpha < 100)
            {
                _color = Draw.Utility.AdjustOpacity(_color, _alpha);
            }

            Idaho.Draw.Triangle draw = new Idaho.Draw.Triangle(_direction);
            draw.Width            = base.Width;
            draw.Height           = base.Height;
            draw.Color.BackGround = System.Drawing.Color.Transparent;
            draw.Color.ForeGround = _color;
            draw.Create();
            this.Bitmap = draw.Bitmap;
        }