Example #1
0
        //public void DrawImage(ImagePlus image,
        //                  PointF[] destPoints,
        //                 float srcx,
        //                 float srcy,
        //                 float srcwidth,
        //                 float srcheight,
        //                 Unit srcUnit,
        //                  ImageAttributesPlus imageAttributes)
        //{
        //    SetStatus(GdiPlus.GdipDrawImagePointsRect(nativeGraphics,
        //                                                         image != null ? image.nativeImage
        //                                                               : null,
        //                                                         destPoints, destPoints.Length,
        //                                                         srcx, srcy,
        //                                                         srcwidth,
        //                                                         srcheight,
        //                                                         srcUnit,
        //                                                         imageAttributes != null
        //                                                          ? imageAttributes.nativeImageAttr
        //                                                          : new GpImageAttributes(),
        //                                                         IntPtr.Zero,
        //                                                         IntPtr.Zero));
        //}

        //public void DrawImage(ImagePlus image,
        //                 int x,
        //                 int y,
        //                 int srcx,
        //                 int srcy,
        //                 int srcwidth,
        //                 int srcheight,
        //                 Unit srcUnit)
        //{
        //    SetStatus(GdiPlus.GdipDrawImagePointRectI(nativeGraphics,
        //                                                         image != null ? image.nativeImage
        //                                                               : null,
        //                                                         x,
        //                                                         y,
        //                                                         srcx,
        //                                                         srcy,
        //                                                         srcwidth,
        //                                                         srcheight,
        //                                                         srcUnit));
        //}

        //public void DrawImage(ImagePlus image,
        //                  Rectangle destRect,
        //                 int srcx,
        //                 int srcy,
        //                 int srcwidth,
        //                 int srcheight,
        //                 Unit srcUnit,
        //                  ImageAttributesPlus imageAttributes)
        //{
        //    SetStatus(GdiPlus.GdipDrawImageRectRectI(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));
        //}

        public void DrawImage(ImagePlus image,
                              Point[] destPoints,
                              int srcx,
                              int srcy,
                              int srcwidth,
                              int srcheight,
                              Unit srcUnit,
                              ImageAttributesPlus imageAttributes)
        {
            SetStatus(GdiPlus.GdipDrawImagePointsRectI(nativeGraphics,
                                                       image != null ? image.nativeImage
                                                                        : null,
                                                       destPoints,
                                                       destPoints.Length,
                                                       srcx,
                                                       srcy,
                                                       srcwidth,
                                                       srcheight,
                                                       srcUnit,
                                                       imageAttributes != null
                                                                   ? imageAttributes.nativeImageAttr
                                                                   : new GpImageAttributes(),
                                                       IntPtr.Zero,
                                                       IntPtr.Zero));
        }
Example #2
0
        public void DrawImage(ImagePlus image, RectangleF rect)
        {
            Unit       unit;
            RectangleF bounds = image.GetBounds(out unit);

            DrawImage(image, rect, 0, 0, bounds.Width, bounds.Height, unit, null);
        }
Example #3
0
 public void DrawImage(ImagePlus image,
                       RectangleF destRect,
                       float srcx,
                       float srcy,
                       float srcwidth,
                       float srcheight,
                       Unit srcUnit,
                       ImageAttributesPlus imageAttributes)
 {
     SetStatus(GdiPlus.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));
 }
Example #4
0
 public void DrawImage(ImagePlus image,
                       int x,
                       int y,
                       int width,
                       int height)
 {
     DrawImage(image, new RectangleF(x, y, width, height));
 }
Example #5
0
 public void DrawImage(ImagePlus image, Rectangle rect)
 {
     DrawImage(image,
               rect.X,
               rect.Y,
               rect.Width,
               rect.Height);
 }
Example #6
0
        public void DrawImage(ImagePlus image, int x, int y)
        {
            Unit       unit;
            RectangleF bounds = image.GetBounds(out unit);

            bounds.X += x;
            bounds.Y += y;
            DrawImage(image, bounds, 0, 0, bounds.Width, bounds.Height, unit, null);
        }
Example #7
0
        public GraphicsPlus(ImagePlus image)
        {
            GpGraphics Graphics = new GpGraphics();

            if (image != null)
            {
                lastResult = GdiPlus.GdipGetImageGraphicsContext(image.nativeImage, out Graphics);
            }
            SetNativeGraphics(Graphics);
        }
Example #8
0
        public GraphicsPlus(ImagePlus image)
        {
            GpGraphics Graphics = new GpGraphics();

            if (image != null)
            {
                lastResult = GdiPlus.GdipGetImageGraphicsContext(image.nativeImage, out Graphics);
            }
            SetNativeGraphics(Graphics);
        }
Example #9
0
        public void DrawImage(ImagePlus image,
                              float x,
                              float y,
                              float width,
                              float height)
        {
            Unit       unit;
            RectangleF bounds = image.GetBounds(out unit);

            DrawImage(image, new RectangleF(x, y, width, height), 0, 0, bounds.Width, bounds.Height, unit, null);
        }
Example #10
0
        ImagePlus GetImage()
        {
            GpImage image;

            SetStatus(GdiPlus.GdipGetTextureImage((GpTexture)nativeBrush,
                                                  out image));

            ImagePlus retimage = new ImagePlus(image, lastResult);

            return(retimage);
        }
Example #11
0
        public void DrawImage(ImagePlus image,
                              float x,
                              float y,
                              float srcx,
                              float srcy,
                              float srcwidth,
                              float srcheight,
                              Unit srcUnit)
        {
            Unit       unit;
            RectangleF bounds = image.GetBounds(out unit);

            DrawImage(image, new RectangleF(x, y, srcwidth, srcheight), srcx, srcy, srcwidth, srcheight, srcUnit, null);
        }
Example #12
0
        public void DrawImage(ImagePlus image, PointF[] destPoints)
        {
            int count = destPoints.Length;

            if (count != 3 && count != 4)
            {
                SetStatus(GpStatus.InvalidParameter);
            }

            SetStatus(GdiPlus.GdipDrawImagePoints(nativeGraphics,
                                                  image != null ? image.nativeImage
                                                                   : new GpImage(),
                                                  destPoints, count));
        }
Example #13
0
        // 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,
                         RectangleF dstRect)
        {
            GpTexture texture;

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

            SetNativeBrush(texture);
        }
Example #14
0
        TextureBrushPlus(ImagePlus image,
                         Rectangle dstRect,
                         ImageAttributesPlus imageAttributes)
        {
            GpTexture texture;

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

            SetNativeBrush(texture);
        }
Example #15
0
        public TextureBrushPlus(ImagePlus image,
                                WrapMode wrapMode)
        {
            GpTexture texture;

            Unit       unit;
            RectangleF rc = image.GetBounds(out unit);

            lastResult = GdiPlus.GdipCreateTextureIA(
                image.nativeImage,
                new GpImageAttributes(),
                rc.X,
                rc.Y,
                rc.Width,
                rc.Height,
                out texture);

            SetNativeBrush(texture);
        }
Example #16
0
        TextureBrushPlus(ImagePlus image,
                         WrapMode wrapMode,
                         int dstX,
                         int dstY,
                         int dstWidth,
                         int dstHeight)
        {
            GpTexture texture;

            lastResult = GdiPlus.GdipCreateTexture2I(
                image.nativeImage,
                wrapMode,
                dstX,
                dstY,
                dstWidth,
                dstHeight,
                out texture);

            SetNativeBrush(texture);
        }
Example #17
0
        public TextureBrushPlus(ImagePlus image,
            WrapMode wrapMode)
        {
            GpTexture texture;

            Unit unit;
            RectangleF rc = image.GetBounds(out unit);
            lastResult = GdiPlus.GdipCreateTextureIA(
                                                      image.nativeImage,
                                                      new GpImageAttributes(),
                                                      rc.X,
                                                      rc.Y,
                                                      rc.Width,
                                                      rc.Height,
                                                      out texture);

            SetNativeBrush(texture);
        }
Example #18
0
 //public void DrawImage(ImagePlus image,
 //                  PointF[] destPoints,
 //                 float srcx,
 //                 float srcy,
 //                 float srcwidth,
 //                 float srcheight,
 //                 Unit srcUnit,
 //                  ImageAttributesPlus imageAttributes)
 //{
 //    SetStatus(GdiPlus.GdipDrawImagePointsRect(nativeGraphics,
 //                                                         image != null ? image.nativeImage
 //                                                               : null,
 //                                                         destPoints, destPoints.Length,
 //                                                         srcx, srcy,
 //                                                         srcwidth,
 //                                                         srcheight,
 //                                                         srcUnit,
 //                                                         imageAttributes != null
 //                                                          ? imageAttributes.nativeImageAttr
 //                                                          : new GpImageAttributes(),
 //                                                         IntPtr.Zero,
 //                                                         IntPtr.Zero));
 //}
 //public void DrawImage(ImagePlus image,
 //                 int x,
 //                 int y,
 //                 int srcx,
 //                 int srcy,
 //                 int srcwidth,
 //                 int srcheight,
 //                 Unit srcUnit)
 //{
 //    SetStatus(GdiPlus.GdipDrawImagePointRectI(nativeGraphics,
 //                                                         image != null ? image.nativeImage
 //                                                               : null,
 //                                                         x,
 //                                                         y,
 //                                                         srcx,
 //                                                         srcy,
 //                                                         srcwidth,
 //                                                         srcheight,
 //                                                         srcUnit));
 //}
 //public void DrawImage(ImagePlus image,
 //                  Rectangle destRect,
 //                 int srcx,
 //                 int srcy,
 //                 int srcwidth,
 //                 int srcheight,
 //                 Unit srcUnit,
 //                  ImageAttributesPlus imageAttributes)
 //{
 //    SetStatus(GdiPlus.GdipDrawImageRectRectI(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));
 //}
 public void DrawImage(ImagePlus image,
                   Point[] destPoints,
                  int srcx,
                  int srcy,
                  int srcwidth,
                  int srcheight,
                  Unit srcUnit,
                   ImageAttributesPlus imageAttributes)
 {
     SetStatus(GdiPlus.GdipDrawImagePointsRectI(nativeGraphics,
                                                           image != null ? image.nativeImage
                                                                 : null,
                                                           destPoints,
                                                           destPoints.Length,
                                                           srcx,
                                                           srcy,
                                                           srcwidth,
                                                           srcheight,
                                                           srcUnit,
                                                           imageAttributes != null
                                                            ? imageAttributes.nativeImageAttr
                                                            : new GpImageAttributes(),
                                                           IntPtr.Zero,
                                                           IntPtr.Zero));
 }
Example #19
0
 public void DrawImage(ImagePlus image, Point point)
 {
     DrawImage(image, point.X, point.Y);
 }
Example #20
0
 public void DrawImage(ImagePlus image,
                  float x,
                  float y,
                  float srcx,
                  float srcy,
                  float srcwidth,
                  float srcheight,
                  Unit srcUnit)
 {
     Unit unit;
     RectangleF bounds = image.GetBounds(out unit);
     DrawImage(image, new RectangleF(x, y, srcwidth, srcheight), srcx, srcy, srcwidth, srcheight, srcUnit, null);
 }
Example #21
0
 public void DrawImage(ImagePlus image,
                   RectangleF destRect,
                  float srcx,
                  float srcy,
                  float srcwidth,
                  float srcheight,
                  Unit srcUnit,
                   ImageAttributesPlus imageAttributes)
 {
     SetStatus(GdiPlus.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));
 }
Example #22
0
 public void DrawImage(ImagePlus image,
                  int x,
                  int y,
                  int width,
                  int height)
 {
     DrawImage(image, new RectangleF(x, y, width, height));
 }
Example #23
0
        public void DrawImage(ImagePlus image,  Point[] destPoints)
        {
            int count = destPoints.Length;
            if (count != 3 && count != 4)
                SetStatus(GpStatus.InvalidParameter);

            SetStatus(GdiPlus.GdipDrawImagePointsI(nativeGraphics,
                                                              image != null ? image.nativeImage
                                                                    : null,
                                                              destPoints,
                                                              count));
        }
Example #24
0
 public void DrawImage(ImagePlus image, int x,   int y)
 {
     Unit unit;
     RectangleF bounds = image.GetBounds(out unit);
     bounds.X += x;
     bounds.Y += y;
     DrawImage(image, bounds, 0, 0, bounds.Width, bounds.Height, unit, null);
 }
Example #25
0
 public void DrawImage(ImagePlus image,  Rectangle rect)
 {
     DrawImage(image,
                      rect.X,
                      rect.Y,
                      rect.Width,
                      rect.Height);
 }
Example #26
0
 public void DrawImage(ImagePlus image,
                  float x,
                  float y,
                  float width,
                  float height)
 {
     Unit unit;
     RectangleF bounds = image.GetBounds(out unit);
     DrawImage(image, new RectangleF(x, y, width, height), 0, 0, bounds.Width, bounds.Height, unit, null);
 }
Example #27
0
 public void DrawImage(ImagePlus image,  Point point)
 {
     DrawImage(image, point.X, point.Y);
 }
Example #28
0
 public void DrawImage(ImagePlus image, RectangleF rect)
 {
     Unit unit;
     RectangleF bounds = image.GetBounds(out unit);
      DrawImage(image, rect, 0, 0, bounds.Width, bounds.Height, unit, null);
 }
Example #29
0
 public void DrawImage(ImagePlus image, float x, float y)
 {
     SetStatus(GdiPlus.GdipDrawImage(nativeGraphics,
                                     image != null ? image.nativeImage : null, x, y));
 }
Example #30
0
 private ImagePlus(ImagePlus C)
 {
     GdiPlus.GdipCloneImage(C.nativeImage, out this.nativeImage);
 }
Example #31
0
        TextureBrushPlus(ImagePlus image,
            WrapMode wrapMode,
            int dstX,
            int dstY,
            int dstWidth,
            int dstHeight)
        {
            GpTexture texture;

            lastResult = GdiPlus.GdipCreateTexture2I(
                                                        image.nativeImage,
                                                        wrapMode,
                                                        dstX,
                                                        dstY,
                                                        dstWidth,
                                                        dstHeight,
                                                        out texture);

            SetNativeBrush(texture);
        }
Example #32
0
        TextureBrushPlus(ImagePlus image,
            Rectangle dstRect,
            ImageAttributesPlus imageAttributes)
        {
            GpTexture texture;

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

            SetNativeBrush(texture);
        }
Example #33
0
        TextureBrushPlus(
            ImagePlus image,
            WrapMode wrapMode,
            
            Rectangle dstRect
            )
        {
            GpTexture texture;

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

            SetNativeBrush(texture);
        }
Example #34
0
 public static GraphicsPlus FromImage(ImagePlus image)
 {
     return new GraphicsPlus(image);
 }
Example #35
0
        ImagePlus GetImage()
        {
            GpImage image;

            SetStatus(GdiPlus.GdipGetTextureImage((GpTexture)nativeBrush,
                                                      out image));

            ImagePlus retimage = new ImagePlus(image, lastResult);

            return retimage;
        }
Example #36
0
 public void DrawImage(ImagePlus image, float x, float y)
 {
     SetStatus(GdiPlus.GdipDrawImage(nativeGraphics,
                                                image != null ? image.nativeImage : null, x,y));
 }
Example #37
0
 private ImagePlus(ImagePlus C)
 {
     GdiPlus.GdipCloneImage(C.nativeImage, out this.nativeImage);
 }
Example #38
0
 public static GraphicsPlus FromImage(ImagePlus image)
 {
     return(new GraphicsPlus(image));
 }