当前位置: 首页>>代码示例>>C#>>正文


C# Cairo.FillRectangle方法代码示例

本文整理汇总了C#中Cairo.FillRectangle方法的典型用法代码示例。如果您正苦于以下问题:C# Cairo.FillRectangle方法的具体用法?C# Cairo.FillRectangle怎么用?C# Cairo.FillRectangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cairo的用法示例。


在下文中一共展示了Cairo.FillRectangle方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Render

 public void Render(Cairo.Context c, MonoReports.Model.Controls.Control control)
 {
     Section section = control as Section;
     Rectangle borderRect;
     c.Save ();
     borderRect = new Rectangle (section.Location.X * unitMulitipier , section.Location.Y * unitMulitipier , section.Width * unitMulitipier, section.Height * unitMulitipier);
     c.FillRectangle (borderRect, section.BackgroundColor.ToCairoColor());
     c.Restore ();
 }
开发者ID:elsupergomez,项目名称:monoreports,代码行数:9,代码来源:SectionRenderer.cs

示例2: Render

 public void Render(Cairo.Context c, MonoReports.Model.Controls.Control control)
 {
     SubReport subreport = control as SubReport;
     Rectangle borderRect;
     c.Save ();
     borderRect = new Rectangle (subreport.Location.X, subreport.Location.Y, subreport.Width, subreport.Height);
     c.ClipRectangle (borderRect);
     borderRect = new Rectangle (subreport.Location.X, subreport.Location.Y, subreport.Width, subreport.Height);
     c.FillRectangle (borderRect, subreport.BackgroundColor.ToCairoColor ());
     c.Restore ();
 }
开发者ID:elsupergomez,项目名称:monoreports,代码行数:11,代码来源:SubreportRenderer.cs

示例3: Render

        public void Render(Cairo.Context c, MonoReports.Model.Controls.Control control)
        {
            Image image = control as Image;
            Rectangle borderRect;
            c.Save ();
            borderRect = new Rectangle (image.Location.X  * unitMulitipier, image.Location.Y  * unitMulitipier, image.Width   * unitMulitipier, image.Height * unitMulitipier);
            c.ClipRectangle (borderRect);

            if ( PixbufRepository.ContainsKey(image.ImageKey)) {
                var pixbuf = PixbufRepository[image.ImageKey];
                c.DrawPixbuf (pixbuf, new Cairo.PointD(image.Location.X * unitMulitipier , image.Location.Y  * unitMulitipier), (int)(image.Width * unitMulitipier),(int)(image.Height * unitMulitipier), image.Offset.ToCairoPointD ());
            }else {
                c.FillRectangle (borderRect, image.BackgroundColor.ToCairoColor ());
            }
            c.DrawInsideBorder (borderRect, image.Border, true);
            c.Restore ();
        }
开发者ID:elsupergomez,项目名称:monoreports,代码行数:17,代码来源:ImageRenderer.cs

示例4: DrawBackground

        private void DrawBackground(Cairo.Context g, Cairo.Rectangle rect, StyleInfo si)
        {
//            LinearGradientBrush linGrBrush = null;
//            SolidBrush sb = null;
            if (si.BackgroundColor.IsEmpty)
                return;
			
            g.Save();
            Cairo.Color c = si.BackgroundColor.ToCairoColor();
            Cairo.Gradient gradient = null;
			
            if (si.BackgroundGradientType != BackgroundGradientTypeEnum.None &&
                !si.BackgroundGradientEndColor.IsEmpty)
            {
                Cairo.Color ec = si.BackgroundGradientEndColor.ToCairoColor();

                switch (si.BackgroundGradientType)
                {
                    case BackgroundGradientTypeEnum.LeftRight:
//                            linGrBrush = new LinearGradientBrush(rect, c, ec, LinearGradientMode.Horizontal);
                        gradient = new Cairo.LinearGradient(rect.X, rect.Y, rect.X + rect.Width, rect.Y);
                        break;
                    case BackgroundGradientTypeEnum.TopBottom:
//                            linGrBrush = new LinearGradientBrush(rect, c, ec, LinearGradientMode.Vertical);
                        gradient = new Cairo.LinearGradient(rect.X, rect.Y, rect.X, rect.Y + rect.Height);
                        break;
                    case BackgroundGradientTypeEnum.Center:
//                            linGrBrush = new LinearGradientBrush(rect, c, ec, LinearGradientMode.Horizontal);
                        throw new NotSupportedException();
//                            break;
                    case BackgroundGradientTypeEnum.DiagonalLeft:
//                            linGrBrush = new LinearGradientBrush(rect, c, ec, LinearGradientMode.ForwardDiagonal);
                        gradient = new Cairo.LinearGradient(rect.X, rect.Y, rect.X + rect.Width, rect.Y + rect.Height);
                        break;
                    case BackgroundGradientTypeEnum.DiagonalRight:
//                            linGrBrush = new LinearGradientBrush(rect, c, ec, LinearGradientMode.BackwardDiagonal);
                        gradient = new Cairo.LinearGradient(rect.X + rect.Width, rect.Y + rect.Height, rect.X, rect.Y);
                        break;
                    case BackgroundGradientTypeEnum.HorizontalCenter:
//                            linGrBrush = new LinearGradientBrush(rect, c, ec, LinearGradientMode.Horizontal);
                        throw new NotSupportedException();
//							break;
                    case BackgroundGradientTypeEnum.VerticalCenter:
//                            linGrBrush = new LinearGradientBrush(rect, c, ec, LinearGradientMode.Vertical);
                        throw new NotSupportedException();
//							break;
                    default:
                        break;
                }
					
                gradient.AddColorStop(0, c);
                gradient.AddColorStop(1, ec);
            }

            if (gradient != null)
            {
////                    g.FillRectangle(linGrBrush, rect);
                g.FillRectangle(rect, gradient);
                gradient.Destroy();	
            }
            else if (!si.BackgroundColor.IsEmpty)
            {
                g.FillRectangle(rect, c);
//					g.DrawRoundedRectangle (rect, 2, c, 1);
					
//					g.FillRoundedRectangle (rect, 8, c);
            }
            g.Restore();
        }
开发者ID:myersBR,项目名称:My-FyiReporting,代码行数:69,代码来源:RenderCairo.cs

示例5: Render

        public void Render(Cairo.Context c,Control control)
        {
            TextBlock textBlock = control as TextBlock;
            Rectangle borderRect;
            c.Save();
            borderRect = new Rectangle (textBlock.Location.X, textBlock.Location.Y, textBlock.Width, textBlock.Height);
            if(!textBlock.CanGrow || DesignMode)
                c.ClipRectangle(borderRect);

            var rect = c.DrawTextBlock (textBlock,false);
            if(!DesignMode && (textBlock.CanGrow && rect.Height > textBlock.Height || textBlock.CanShrink && rect.Height < textBlock.Height)){
                borderRect = new Rectangle (textBlock.Location.X, textBlock.Location.Y, textBlock.Width, rect.Height);
            } else {
                borderRect = new Rectangle (textBlock.Location.X, textBlock.Location.Y, textBlock.Width, textBlock.Height);
            }

            c.FillRectangle(borderRect,textBlock.BackgroundColor.ToCairoColor());
            c.DrawTextBlock (textBlock,true);
            c.DrawInsideBorder  (borderRect, textBlock.Border,true);
            c.Restore();
        }
开发者ID:modesto,项目名称:monoreports,代码行数:21,代码来源:TextBlockRenderer.cs

示例6: Render

        public override void Render(Cairo.Context c)
        {
            InvalidateBound ();

            c.Save ();
            c.FillRectangle (AbsoluteBound, section.BackgroundColor.ToCairoColor ());

            Rectangle r = new Rectangle (AbsoluteBound.X, AbsoluteBound.Y, parentReport.Width, SectionheaderHeight);
            Cairo.Gradient pat = new Cairo.LinearGradient (0, AbsoluteBound.Y, 0, AbsoluteBound.Y + SectionheaderHeight);
            pat.AddColorStop (0, sectionHeaderColor);
            pat.AddColorStop (1, sectionHeaderColor1);
            c.FillRectangle (r, pat);
            c.DrawText (new Cairo.PointD (r.X + 3, r.Y + 3), "Tahoma", Cairo.FontSlant.Normal, Cairo.FontWeight.Normal, 11, blackColor, 600, Section.Name);
            c.FillRectangle (GripperAbsoluteBound, SectionGripperColor);
            c.Translate (AbsoluteDrawingStartPoint.X, AbsoluteDrawingStartPoint.Y);

            for (int j = 0; j < Controls.Count; j++) {
                    var ctrl = Controls [j];
                    ctrl.Render (c);
            }

            c.Restore ();
        }
开发者ID:modesto,项目名称:monoreports,代码行数:23,代码来源:SectionView.cs


注:本文中的Cairo.FillRectangle方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。