コード例 #1
0
 public void GetBounds(out GpRectF rect)
 {
     rect.X      = X;
     rect.Y      = Y;
     rect.Width  = Width;
     rect.Height = Height;
 }
コード例 #2
0
 public bool IntersectsWith(GpRectF rect)
 {
     return(GetLeft() < rect.GetRight() &&
            GetTop() < rect.GetBottom() &&
            GetRight() > rect.GetLeft() &&
            GetBottom() > rect.GetTop());
 }
コード例 #3
0
 public bool Equals(GpRectF rect)
 {
     return(X == rect.X &&
            Y == rect.Y &&
            Width == rect.Width &&
            Height == rect.Height);
 }
コード例 #4
0
 GetBounds(out GpRectF rect,
           GraphicsPlus g)
 {
     return(SetStatus(NativeMethods.GdipGetRegionBounds(nativeRegion,
                                                        g.nativeGraphics,
                                                        out rect)));
 }
コード例 #5
0
ファイル: GraphicsPath.cs プロジェクト: misiek/foo
 public GpStatus AddArc(GpRectF rect,
           float startAngle,
           float sweepAngle)
 {
     return AddArc(rect.X, rect.Y, rect.Width, rect.Height,
                   startAngle, sweepAngle);
 }
コード例 #6
0
 public GpStatus AddPie(GpRectF rect,
                        float startAngle,
                        float sweepAngle)
 {
     return(AddPie(rect.X, rect.Y, rect.Width, rect.Height, startAngle,
                   sweepAngle));
 }
コード例 #7
0
        // Once this is called, the resultant path is made of line segments and
        // the original path information is lost.  When matrix is null, the
        // identity matrix is assumed.

        public GpStatus Warp(GpPointF[] destPoints,
                             GpRectF srcRect,
                             Matrix matrix,
                             WarpMode warpMode,
                             float flatness)
        {
            GpMatrix nativeMatrix = new GpMatrix();

            if (matrix != null)
            {
                nativeMatrix = matrix.nativeMatrix;
            }

            return(SetStatus(NativeMethods.GdipWarpPath(
                                 nativePath,
                                 nativeMatrix,
                                 destPoints,
                                 destPoints.Length,
                                 srcRect.X,
                                 srcRect.Y,
                                 srcRect.Width,
                                 srcRect.Height,
                                 warpMode,
                                 flatness)));
        }
コード例 #8
0
ファイル: RegionPlus.cs プロジェクト: intille/mitessoftware
        RegionPlus(GpRectF rect)
        {
            GpRegion region = new GpRegion();

            lastResult = NativeMethods.GdipCreateRegionRect(ref rect, out region);

            SetNativeRegion(region);
        }
コード例 #9
0
        RegionPlus(GpRectF rect)
        {
            GpRegion region = new GpRegion();

            lastResult = NativeMethods.GdipCreateRegionRect(ref rect, out region);

            SetNativeRegion(region);
        }
コード例 #10
0
ファイル: Matrix.cs プロジェクト: mitice/foo
        Matrix(GpRectF rect,
               GpPointF[] dstplg)
        {
            GpMatrix matrix;

            lastResult = NativeMethods.GdipCreateMatrix3(rect,
                                                         dstplg,
                                                         out matrix);

            SetNativeMatrix(matrix);
        }
コード例 #11
0
ファイル: Matrix.cs プロジェクト: intille/mitessoftware
    Matrix( GpRectF rect, 
            GpPointF[] dstplg)
    {
        GpMatrix matrix;

        lastResult = NativeMethods.GdipCreateMatrix3(rect, 
                                                   dstplg,
                                                   out matrix);

        SetNativeMatrix(matrix);
    }
コード例 #12
0
ファイル: PenDemo.cs プロジェクト: misiek/foo
        private void Draw(Graphics graphics, GraphicsPlus g)
        {
            StringFormat sf = new StringFormat();
            sf.LineAlignment = sf.Alignment = System.Drawing.StringAlignment.Center;
            int deltaH = ClientRectangle.Height / 8;
            GpRectF rc = new GpRectF(0, 0, ClientRectangle.Width, deltaH);
            RectangleF rcf = new RectangleF(0, 0, ClientRectangle.Width, deltaH);

            using (SolidBrush brText = new SolidBrush(Color.Black))
            using (Font fnt = new Font("Tahoma", 9, System.Drawing.FontStyle.Bold))
            {
                penSolid.SetWidth(15);
                g.DrawLine(penSolid, 5, rcf.Top + 10, rc.Width - 10, rcf.Top + 10);
                graphics.DrawString("Solid with caps", fnt, brText, rcf, sf);
                rcf.Y += deltaH; rc.Offset(0, deltaH);

                SmoothingMode mode = g.GetSmoothingMode();
                g.SetSmoothingMode(SmoothingMode.SmoothingModeAntiAlias);

                penSolid.SetColor(Color.Blue);
                g.DrawLine(penSolid, 5, rcf.Top + 10, rc.Width - 10, rcf.Top + 10);
                graphics.DrawString("Solid with caps and anitalising", fnt, brText, rcf, sf);
                rcf.Y += deltaH; rc.Offset(0, deltaH);

                g.DrawLine(penHatch, 5, rcf.Top + 10, rc.Width - 10, rcf.Top + 10);
                graphics.DrawString("Hatched", fnt, brText, rcf, sf);
                rcf.Y += deltaH; rc.Offset(0, deltaH);

                penSolidTrans.SetWidth(20);
                penSolidTrans.SetLineCap(LineCap.LineCapRound, LineCap.LineCapDiamondAnchor, DashCap.DashCapRound);
                graphics.DrawString("Solid with transparency", fnt, brText, rcf, sf);
                g.DrawLine(penSolidTrans, 15, rcf.Top + 10, rc.Width - 30, rcf.Top + 10);
                rcf.Y += deltaH; rc.Offset(0, deltaH);

                g.SetSmoothingMode(SmoothingMode.SmoothingModeAntiAlias);
                brText.Color = Color.White;
                g.DrawLine(penSolidCustomCap, 15, rcf.Top + 15, rc.Width - 50, rcf.Top + 15);
                graphics.DrawString("Custom cap", fnt, brText, rcf, sf);
                rcf.Y += deltaH; rc.Offset(0, deltaH);
                g.SetSmoothingMode(mode);

                brText.Color = Color.Gray;
                g.DrawLine(penDash, 5, rcf.Top + 10, rc.Width - 10, rcf.Top + 10);
                graphics.DrawString("Dash (round)", fnt, brText, rcf, sf);
                rcf.Y += deltaH; rc.Offset(0, deltaH);

                brText.Color = Color.White;
                g.DrawLine(penGradient, 15, rcf.Top + 20, rc.Width - 30, rcf.Top + 20);
                graphics.DrawString("Gradient brush-based", fnt, brText, rcf, sf);
                rcf.Y += deltaH; rc.Offset(0, deltaH);

            }
        }
コード例 #13
0
 public GpStatus AddRectangle(GpRectF rect)
 {
     return(SetStatus(NativeMethods.GdipAddPathPolygon(nativePath,
                                                       new GpPointF[]
     {
         new GpPointF(rect.X, rect.Y),
         new GpPointF(rect.X, rect.Y + rect.Height),
         new GpPointF(rect.X + rect.Width, rect.Y + rect.Height),
         new GpPointF(rect.X + rect.Width, rect.Y),
     },
                                                       4)));
 }
コード例 #14
0
        IsVisible(GpRectF rect,
                  GraphicsPlus g)
        {
            bool booln = false;

            SetStatus(NativeMethods.GdipIsVisibleRegionRect(nativeRegion, rect.X,
                                                            rect.Y, rect.Width,
                                                            rect.Height,
                                                            (g == null) ?
                                                            new GpGraphics() : g.nativeGraphics,
                                                            out booln));
            return(booln);
        }
コード例 #15
0
        static public bool Union(out GpRectF c,
                                 GpRectF a,
                                 GpRectF b)
        {
            float right  = Math.Max(a.GetRight(), b.GetRight());
            float bottom = Math.Max(a.GetBottom(), b.GetBottom());
            float left   = Math.Min(a.GetLeft(), b.GetLeft());
            float top    = Math.Min(a.GetTop(), b.GetTop());

            c.X      = left;
            c.Y      = top;
            c.Width  = right - left;
            c.Height = bottom - top;
            return(!c.IsEmptyArea());
        }
コード例 #16
0
ファイル: BrushPlus.cs プロジェクト: mitice/foo
        public LinearGradientBrush(GpRectF rect,
                                   Color color1,
                                   Color color2,
                                   LinearGradientMode mode)
        {
            GpLineGradient brush;

            lastResult = NativeMethods.GdipCreateLineBrushFromRect(ref rect,
                                                                   color1.ToArgb(),
                                                                   color2.ToArgb(),
                                                                   mode,
                                                                   WrapMode.WrapModeTile,
                                                                   out brush);

            SetNativeBrush(brush);
        }
コード例 #17
0
ファイル: BrushPlus.cs プロジェクト: mitice/foo
        // When creating a texture brush from a metafile image, the dstRect
        // is used to specify the size that the metafile image should be
        // rendered at in the device units of the destination graphics.
        // It is NOT used to crop the metafile image, so only the width
        // and height values matter for metafiles.

        TextureBrushPlus(ImagePlus image,
                         WrapMode wrapMode,
                         GpRectF dstRect)
        {
            GpTexture texture;

            lastResult = NativeMethods.GdipCreateTexture2(
                image.nativeImage,
                wrapMode,
                dstRect.X,
                dstRect.Y,
                dstRect.Width,
                dstRect.Height,
                out texture);

            SetNativeBrush(texture);
        }
コード例 #18
0
ファイル: BrushPlus.cs プロジェクト: mitice/foo
        public TextureBrushPlus(ImagePlus image,
                                GpRectF dstRect,
                                ImageAttributesPlus imageAttributes)
        {
            GpTexture texture;

            lastResult = NativeMethods.GdipCreateTextureIA(
                image.nativeImage,
                (imageAttributes != null) ? imageAttributes.nativeImageAttr : new GpImageAttributes(),
                dstRect.X,
                dstRect.Y,
                dstRect.Width,
                dstRect.Height,
                out texture
                );

            SetNativeBrush(texture);
        }
コード例 #19
0
ファイル: BrushPlus.cs プロジェクト: mitice/foo
        LinearGradientBrush(GpRectF rect,
                            Color color1,
                            Color color2,
                            float angle,
                            bool isAngleScalable)
        {
            GpLineGradient brush;

            lastResult = NativeMethods.GdipCreateLineBrushFromRectWithAngle(ref rect,
                                                                            color1.ToArgb(),
                                                                            color2.ToArgb(),
                                                                            angle,
                                                                            isAngleScalable,
                                                                            WrapMode.WrapModeTile,
                                                                            out brush);

            SetNativeBrush(brush);
        }
コード例 #20
0
ファイル: GraphicsPlus.cs プロジェクト: misiek/foo
 public GpStatus DrawImage(ImagePlus image,
                   GpRectF destRect,
                  float srcx,
                  float srcy,
                  float srcwidth,
                  float srcheight,
                  Unit srcUnit,
                   ImageAttributesPlus imageAttributes)
 {
     return SetStatus(NativeMethods.GdipDrawImageRectRect(nativeGraphics,
                                                        image != null ? image.nativeImage
                                                              : null,
                                                        destRect.X,
                                                        destRect.Y,
                                                        destRect.Width,
                                                        destRect.Height,
                                                        srcx, srcy,
                                                        srcwidth, srcheight,
                                                        srcUnit,
                                                        imageAttributes != null
                                                         ? imageAttributes.nativeImageAttr
                                                         : new GpImageAttributes(),
                                                        IntPtr.Zero,
                                                        IntPtr.Zero));
 }
コード例 #21
0
ファイル: GraphicsPlus.cs プロジェクト: misiek/foo
 public GpStatus DrawEllipse(PenPlus pen,
                     GpRectF rect)
 {
     return DrawEllipse(pen, rect.X, rect.Y, rect.Width, rect.Height);
 }
コード例 #22
0
ファイル: GraphicsPlus.cs プロジェクト: misiek/foo
 public GpStatus FillRectangles(BrushPlus brush,
                        GpRectF[] rects)
 {
     return SetStatus(NativeMethods.GdipFillRectangles(nativeGraphics,
                                                     brush.nativeBrush,
                                                     rects, rects.Length));
 }
コード例 #23
0
ファイル: GraphicsPlus.cs プロジェクト: misiek/foo
 public GpStatus FillPie(BrushPlus brush,
                 GpRectF rect,
                float startAngle,
                float sweepAngle)
 {
     return FillPie(brush, rect.X, rect.Y, rect.Width, rect.Height,
                    startAngle, sweepAngle);
 }
コード例 #24
0
ファイル: Matrices.cs プロジェクト: intille/mitessoftware
GdipCreateMatrix3(GpRectF rect, GpPointF[] dstplg,
                       out GpMatrix matrix);
コード例 #25
0
ファイル: Drawing.cs プロジェクト: intille/mitessoftware
GdipDrawRectangles(GpGraphics graphics, GpPen pen, GpRectF[] rects,
        int count);
コード例 #26
0
 GdipGetRegionBounds(GpRegion region, GpGraphics graphics,
                     out GpRectF rect);
コード例 #27
0
ファイル: Matrices.cs プロジェクト: misiek/foo
 public static extern GpStatus GdipCreateMatrix3(GpRectF rect, GpPointF[] dstplg,
                out GpMatrix matrix);
コード例 #28
0
ファイル: Image.cs プロジェクト: mitice/foo
 public GpStatus GetBounds(out GpRectF srcRect,
                           out Unit srcUnit)
 {
     return(SetStatus(NativeMethods.GdipGetImageBounds(nativeImage,
                                                       out srcRect, out srcUnit)));
 }
コード例 #29
0
ファイル: Matrices.cs プロジェクト: mitice/foo
 GdipCreateMatrix3(GpRectF rect, GpPointF[] dstplg,
                   out GpMatrix matrix);
コード例 #30
0
ファイル: Paths.cs プロジェクト: intille/mitessoftware
GdipAddPathString(GpPath path, string str,
                        int length, GpFontFamily family, int style,
                        float emSize, GpRectF layoutRect,
                        GpStringFormat format);
コード例 #31
0
ファイル: Graphics.cs プロジェクト: mitice/foo
 GdipGetClipBounds(GpGraphics graphics, out GpRectF rect);
コード例 #32
0
 public bool Contains(GpRectF rect)
 {
     return((X <= rect.X) && (rect.GetRight() <= GetRight()) &&
            (Y <= rect.Y) && (rect.GetBottom() <= GetBottom()));
 }
コード例 #33
0
ファイル: BrushPlus.cs プロジェクト: mitice/foo
 public GpStatus GetRectangle(out GpRectF rect)
 {
     rect = new GpRectF();
     return(SetStatus(NativeMethods.GdipGetPathGradientRect(
                          (GpPathGradient)nativeBrush, out rect)));
 }
コード例 #34
0
 public bool Intersect(GpRectF rect)
 {
     return(Intersect(out this, this, rect));
 }
コード例 #35
0
ファイル: Paths.cs プロジェクト: mitice/foo
 GdipAddPathString(GpPath path, string str,
                   int length, GpFontFamily family, int style,
                   float emSize, GpRectF layoutRect,
                   GpStringFormat format);
コード例 #36
0
 Complement(GpRectF rect)
 {
     return(SetStatus(NativeMethods.GdipCombineRegionRect(nativeRegion, ref rect,
                                                          CombineMode.CombineModeComplement)));
 }
コード例 #37
0
ファイル: GraphicsPlus.cs プロジェクト: misiek/foo
 public GpStatus DrawRectangles(PenPlus pen,
                        GpRectF[] rects)
 {
     return SetStatus(NativeMethods.GdipDrawRectangles(nativeGraphics,
                                                     pen.nativePen,
                                                     rects, rects.Length));
 }
コード例 #38
0
 Exclude(GpRectF rect)
 {
     return(SetStatus(NativeMethods.GdipCombineRegionRect(nativeRegion, ref rect,
                                                          CombineMode.CombineModeExclude)));
 }
コード例 #39
0
ファイル: GraphicsPlus.cs プロジェクト: misiek/foo
 //GpStatus Clear( Color color)
 //{
 //    return SetStatus(NativeMethods.GdipGraphicsPlusClear(
 //        nativeGraphics,
 //        color.ToArgb()));
 //}
 public GpStatus FillRectangle(BrushPlus brush,
                       GpRectF rect)
 {
     return FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height);
 }
コード例 #40
0
ファイル: RegionPlus.cs プロジェクト: intille/mitessoftware
 Complement(GpRectF rect)
  {
      return SetStatus(NativeMethods.GdipCombineRegionRect(nativeRegion, ref rect,
                                                         CombineMode.CombineModeComplement));
  }
コード例 #41
0
ファイル: GraphicsPlus.cs プロジェクト: misiek/foo
 public GpStatus DrawArc(PenPlus pen,
                 GpRectF rect,
                float startAngle,
                float sweepAngle)
 {
     return DrawArc(pen, rect.X, rect.Y, rect.Width, rect.Height,
                    startAngle, sweepAngle);
 }
コード例 #42
0
ファイル: RegionPlus.cs プロジェクト: intille/mitessoftware
       IsVisible(GpRectF rect,
                          GraphicsPlus g)
        {
            bool booln = false;

            SetStatus(NativeMethods.GdipIsVisibleRegionRect(nativeRegion, rect.X,
                                                            rect.Y, rect.Width,
                                                            rect.Height,
                                                            (g == null) ?
                                                              new GpGraphics() : g.nativeGraphics,
                                                            out booln));
            return booln;
        }
コード例 #43
0
ファイル: GraphicsPlus.cs プロジェクト: misiek/foo
 public GpStatus DrawImage(ImagePlus image,
                   GpRectF rect)
 {
     GpRectF bounds; Unit unit;
     image.GetBounds(out bounds, out unit);
     return DrawImage(image, rect, 0, 0, bounds.Width, bounds.Height, unit, null);
 }
コード例 #44
0
 GdipCombineRegionRect(GpRegion region, ref GpRectF rect,
                       CombineMode combineMode);
コード例 #45
0
ファイル: Paths.cs プロジェクト: intille/mitessoftware
GdipAddPathRectangles(GpPath path, GpRectF[] rects, int count);
コード例 #46
0
ファイル: SimpleTypes.cs プロジェクト: intille/mitessoftware
 public bool IntersectsWith(GpRectF rect)
 {
     return (GetLeft() < rect.GetRight() &&
             GetTop() < rect.GetBottom() &&
             GetRight() > rect.GetLeft() &&
             GetBottom() > rect.GetTop());
 }
コード例 #47
0
ファイル: Paths.cs プロジェクト: intille/mitessoftware
GdipGetPathWorldBounds(GpPath  path, GpRectF[] bounds, 
                       out GpMatrix matrix, out GpPen pen);
コード例 #48
0
ファイル: SimpleTypes.cs プロジェクト: intille/mitessoftware
    static public bool Union(out GpRectF c,
                      GpRectF a,
                      GpRectF b)
    {
        float right = Math.Max(a.GetRight(), b.GetRight());
        float bottom = Math.Max(a.GetBottom(), b.GetBottom());
        float left = Math.Min(a.GetLeft(), b.GetLeft());
        float top = Math.Min(a.GetTop(), b.GetTop());

        c.X = left;
        c.Y = top;
        c.Width = right - left;
        c.Height = bottom - top;
        return !c.IsEmptyArea();
    }
コード例 #49
0
 GdipGetImageBounds(GpImage image, out GpRectF srcRect, out Unit srcUnit);
コード例 #50
0
ファイル: Drawing.cs プロジェクト: intille/mitessoftware
GdipFillRectangles(GpGraphics graphics, GpBrush brush,
     GpRectF[] rects, int count);
コード例 #51
0
 public GpStatus AddEllipse(GpRectF rect)
 {
     return(AddEllipse(rect.X, rect.Y, rect.Width, rect.Height));
 }
コード例 #52
0
ファイル: BrushPlus.cs プロジェクト: mitice/foo
 GpStatus GetRectangle(out GpRectF rect)
 {
     return(SetStatus(NativeMethods.GdipGetLineRect((GpLineGradient)nativeBrush, out rect)));
 }
コード例 #53
0
ファイル: SimpleTypes.cs プロジェクト: intille/mitessoftware
 public void GetBounds(out GpRectF rect)
 {
     rect.X = X;
     rect.Y = Y;
     rect.Width = Width;
     rect.Height = Height;
 }
コード例 #54
0
ファイル: SimpleTypes.cs プロジェクト: intille/mitessoftware
 public bool Equals(GpRectF rect)
 {
     return X == rect.X &&
            Y == rect.Y &&
            Width == rect.Width &&
            Height == rect.Height;
 }
コード例 #55
0
ファイル: RegionPlus.cs プロジェクト: intille/mitessoftware
 Exclude(GpRectF rect)
  {
      return SetStatus(NativeMethods.GdipCombineRegionRect(nativeRegion, ref rect,
                                                         CombineMode.CombineModeExclude));
  }
コード例 #56
0
ファイル: SimpleTypes.cs プロジェクト: intille/mitessoftware
 public bool Contains(GpRectF rect)
 {
     return (X <= rect.X) && (rect.GetRight() <= GetRight()) &&
            (Y <= rect.Y) && (rect.GetBottom() <= GetBottom());
 }
コード例 #57
0
ファイル: RegionPlus.cs プロジェクト: intille/mitessoftware
 GetBounds(out GpRectF rect,
                    GraphicsPlus g)
  {
      return SetStatus(NativeMethods.GdipGetRegionBounds(nativeRegion,
                                                  g.nativeGraphics,
                                                  out rect));
  }
コード例 #58
0
ファイル: SimpleTypes.cs プロジェクト: intille/mitessoftware
 public bool Intersect(GpRectF rect)
 {
     return Intersect(out this, this, rect);
 }
コード例 #59
0
ファイル: RegionPlus.cs プロジェクト: intille/mitessoftware
 GetRegionScans(
      Matrix matrix,
     GpRectF[] rects,
      out int count)
  {
      count = rects.Length;
      return SetStatus(NativeMethods.GdipGetRegionScans(nativeRegion,
                                            rects,
                                            ref count,
                                            matrix.nativeMatrix));
  }
コード例 #60
0
 GdipCreateRegionRect(ref GpRectF rect, out GpRegion region);