Esempio n. 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));
        }
Esempio n. 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);
        }
Esempio n. 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));
 }
Esempio n. 4
0
 public void DrawImage(ImagePlus image,
                       int x,
                       int y,
                       int width,
                       int height)
 {
     DrawImage(image, new RectangleF(x, y, width, height));
 }
Esempio n. 5
0
 public void DrawImage(ImagePlus image, Rectangle rect)
 {
     DrawImage(image,
               rect.X,
               rect.Y,
               rect.Width,
               rect.Height);
 }
Esempio n. 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);
        }
Esempio n. 7
0
        public GraphicsPlus(ImagePlus image)
        {
            GpGraphics Graphics = new GpGraphics();

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

            if (image != null)
            {
                lastResult = GdiPlus.GdipGetImageGraphicsContext(image.nativeImage, out Graphics);
            }
            SetNativeGraphics(Graphics);
        }
Esempio n. 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);
        }
Esempio n. 10
0
        ImagePlus GetImage()
        {
            GpImage image;

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

            ImagePlus retimage = new ImagePlus(image, lastResult);

            return(retimage);
        }
Esempio n. 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);
        }
Esempio n. 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));
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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));
 }
Esempio n. 19
0
 public void DrawImage(ImagePlus image, Point point)
 {
     DrawImage(image, point.X, point.Y);
 }
Esempio n. 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);
 }
Esempio n. 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));
 }
Esempio n. 22
0
 public void DrawImage(ImagePlus image,
                  int x,
                  int y,
                  int width,
                  int height)
 {
     DrawImage(image, new RectangleF(x, y, width, height));
 }
Esempio n. 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));
        }
Esempio n. 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);
 }
Esempio n. 25
0
 public void DrawImage(ImagePlus image,  Rectangle rect)
 {
     DrawImage(image,
                      rect.X,
                      rect.Y,
                      rect.Width,
                      rect.Height);
 }
Esempio n. 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);
 }
Esempio n. 27
0
 public void DrawImage(ImagePlus image,  Point point)
 {
     DrawImage(image, point.X, point.Y);
 }
Esempio n. 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);
 }
Esempio n. 29
0
 public void DrawImage(ImagePlus image, float x, float y)
 {
     SetStatus(GdiPlus.GdipDrawImage(nativeGraphics,
                                     image != null ? image.nativeImage : null, x, y));
 }
Esempio n. 30
0
 private ImagePlus(ImagePlus C)
 {
     GdiPlus.GdipCloneImage(C.nativeImage, out this.nativeImage);
 }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 34
0
 public static GraphicsPlus FromImage(ImagePlus image)
 {
     return new GraphicsPlus(image);
 }
Esempio n. 35
0
        ImagePlus GetImage()
        {
            GpImage image;

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

            ImagePlus retimage = new ImagePlus(image, lastResult);

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