예제 #1
0
 public override void FillRect(double x, double y, double width, double height, DColor color, double alpha, DFillStyle fillStyle)
 {
     CairoSetPattern(cr, color, alpha, fillStyle);
     cr.Rectangle(x, y, width, height);
     cr.Fill();
 }
예제 #2
0
 void CairoSetPattern(Context cr, DColor color, double alpha, DFillStyle fillStyle)
 {
     switch (fillStyle)
     {
         case DFillStyle.ForwardDiagonalHatch:
             Surface patSurf = cr.Target.CreateSimilar(Content.ColorAlpha, 7, 7);
             Context patCr = new Context(patSurf);
             patCr.SetSource(MakeColor(color, alpha));
             patCr.LineWidth = 1;
             patCr.MoveTo(0, 0);
             patCr.LineTo(7, 7);
             patCr.Stroke();
             SurfacePattern pat = new SurfacePattern(patSurf);
             pat.Extend = Extend.Repeat;
             cr.SetSource(pat);
             ((IDisposable)patCr).Dispose();
             ((IDisposable)patSurf).Dispose();
             break;
         default:
             cr.SetSource(MakeColor(color, alpha));
             break;
     }
 }
예제 #3
0
 public abstract void FillRect(double x, double y, double width, double height, DColor color, double alpha, DFillStyle fillStyle);
예제 #4
0
 public override void FillRect(double x, double y, double width, double height, DColor color, double alpha, DFillStyle fillStyle)
 {
     UpdateMaxNumOfObjects(1);
     CreateBrushIndirect(1, color);
     SelectObject(1);
     SelectObject((uint)Emf.StockObject.NULL_PEN);
     Rectangle(x, y, width, height);
     DeleteObject(1);
 }
예제 #5
0
 public override void FillRect(double x, double y, double width, double height, DColor color, double alpha, DFillStyle fillStyle)
 {
     CreateBrushIndirect(color);
     SelectObject(0);
     CreatePenIndirect();
     SelectObject(1);
     RectShape(Wmf.Rectangle, (ushort)x, (ushort)y, (ushort)width, (ushort)height);
     DeleteObject(1);
     DeleteObject(0);
 }
예제 #6
0
 // Helper Functions //
 Brush MakeBrush(DFillStyle fillStyle, DColor color, double alpha)
 {
     switch (fillStyle)
     {
         case DFillStyle.ForwardDiagonalHatch:
             return new HatchBrush(HatchStyle.ForwardDiagonal, WFHelper.MakeColor(color, alpha), Color.FromArgb(0, Color.Red));
         default:
             return new SolidBrush(WFHelper.MakeColor(color, alpha)); ;
     }
 }
예제 #7
0
 public override void FillRect(double x, double y, double width, double height, DColor color, double alpha, DFillStyle fillStyle)
 {
     g.FillRectangle(MakeBrush(fillStyle, color, alpha), (float)x, (float)y, (float)width, (float)height);
 }